Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

It compiles but only part of it runs.

 
Paul Roberts
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]
 
Matthew Brown
Bartender
Posts: 4565
8
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic