U
Ueland
I'm looking at the HelloWorld program
class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World");
}
}
When I compile the program above and run it using
the first thing java (I'm writing java because I do not know who does
this thing) does is to initialize a lot of things and then it runs the
main() method above. One of the things that happens behind the scene is
that it imports java.lang and that it creates a PrintStream object in
the Heap and lets the static variable System.out point to it.
I would like to understand how this initialization works. Looking at
the System.java in the package java.lang I find the following code
/**
* Initialize the system class. Called after thread
initialization.
*/
private static void initializeSystemClass() {...
My question is what is calling the thread initialization and what is
calling initializeSystemClass(). In other words how does the
initialization of the environment (in which my program HelloWorld will
execute) begin in the first place. Also what tool or software component
is responsible making all these initializations?
Bob Ueland
class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World");
}
}
When I compile the program above and run it using
java HelloWorld
the first thing java (I'm writing java because I do not know who does
this thing) does is to initialize a lot of things and then it runs the
main() method above. One of the things that happens behind the scene is
that it imports java.lang and that it creates a PrintStream object in
the Heap and lets the static variable System.out point to it.
I would like to understand how this initialization works. Looking at
the System.java in the package java.lang I find the following code
/**
* Initialize the system class. Called after thread
initialization.
*/
private static void initializeSystemClass() {...
My question is what is calling the thread initialization and what is
calling initializeSystemClass(). In other words how does the
initialization of the environment (in which my program HelloWorld will
execute) begin in the first place. Also what tool or software component
is responsible making all these initializations?
Bob Ueland