• Post Reply Bookmark Topic Watch Topic
  • New Topic

It compiles but only part of it runs.  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a total beginner I'm working through a long tutorial. I've decided that I won't move onto the next topic until I understand the

code in the current topic and have seen it run. I have merged two pieces of code from the tutorial. The main method calculates and

prints the number of occurrences of randomly generated numbers from 0 to 9. This part works. However additional code which is

meant to identity largest and smallest elements doesn't seem to do anything. There are no errors when I compile.

If someone would point out why static void printLargestAndSmallestElements (int[] n) { doesn't work in this instance I would be

grateful.

Sorry I haven't highlighted the relevant code. When I try to use the features on this page it just prints text.




[Edit - added code tags - MB]
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If that's the complete code you're using...the reason printLargestAndSmallestElements doesn't do anything is that you don't actually call it anywhere.
 
Let's get him boys! We'll make him read this tiny ad!
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!