title: What are the advantages of using Virtual Machine compilation (eg. JVM) over natively compiled languages?
body: <p>I've heard that the advantage of java is that people can write code, compile it for the JVM, and run it anywhere. Each person just needs a JVM app for their platform. </p>
  
  <p>Of course, it looks similar to the current situation, where everybody has a compiler specific for their platform.  So the advantage isn't explained by that. But I think I see the explanation.. the issue must be that in the java situation, you can't or weren't meant to access the real machine directly in an OS specific way. </p>
  
  <p>I suppose it'd mean that in other languages, the code itself has to be amended depending on what computer it is running on.</p>
  
  <p>Can anybody provide short examples of this like a Hello World program that demonstrates this?  No doubt it'd be in non-java e.g. C</p>
  
  <p>Since it's not something that'd -normally- happen in a Hello World program  or most i've seen since the books I used on java, they were unfortunately "how to program" style books, and all the stuff in them didn't demonstrate it(perhaps 'cos they couldn't or didn't want to use java to demonstrate it!).  Though they trumpeted it as a big advantage. I'd like to see examples of it.</p>