A good answer might be:When run, the program will print: to the monitor.A Greeting! | |
Steps in Program ExecutionHere is how the program does this:
You ordinarilly don't think about what is going on in such detail. But you should be able to do it when you need to. Notice that a String object containing "A Greeting!" is constructed before the HelloObject constructor is even called. Strings are objects (of course) so they must be made with a constructor. Remember that Strings are special because something like "A Greeting!" constructs an object without using the new operator. | |
QUESTION 20:(Trick Question:) How many objects exist just before this program stops running? Click Here after you have answered the question |