This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!