Hello, I think it's pretty normal because in Java evreything is an object, which is made of many others most likely. To write "Hello world" on the screen tons of small elementary istructions are executed, so I think tons of objects must be invoked to do so. You only use one istruction for your convenience, but this doesn't mean behind the scenes things are much more complex. The effort on evrey programming language, in the last decades, has been the one to hide as much information as possible to the programmer, to allow him to work on the program and not on HOW to make it running.
Regards, Maurizio Marrocco On Sun, Jul 12, 2009 at 7:21 AM, Babu Rajendran<[email protected]> wrote: > Hi All, > > I just happened to see the output of a simple Hello World program with the > verbose option. > > Here is the source code of the program. > > class Hello > { > public static void main(String[] args) > { > System.out.println("Hello World!"); > } > } > > java -verbose Hello //This is the command I have given to run the program. > > When I look at the output it shows me the names of so many classes getting > loaded. I have attached a text file which contains the complete output. > My question is why are so many classes getting loaded even for running this > very basic program. AFAIK the package java.lang is imported by default and > hence it makes sense that the classes in java.lang package are loaded. But I > do see classes from other packages which I have not even imported, getting > loaded. What is happening behind the screens? > > > > Regards, > Babu > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
