Question: Given: After typing java SayHelloTo Bubba on the command line (with a space before and after the class name) this program prints Hello Bubba: public
Given: After typing "java SayHelloTo Bubba" on the command line (with a space before and after the class name) this program prints "Hello Bubba":
public class SayHelloTo { public static void main(String[] args) { System.out.println("Hello " + args[0]); } }
Form an answer of eight T and F characters to specify that each of the following 8 statements is true or false.
1. Before the main() method is called, the CommandLineLoader creates a String in DYNAMIC memory with characters "Bubba" and sets the memory address of the String in the args array. 2. The compiler generates code for the main() method that creates a String in DYNAMIC memory with characters "Hello" and puts the address of that String in the args array. 3. During execution of this program, a SayHelloTo program object is created in DYNAMIC memory. 4. When the program executes, the no-arg constructor (added by the compiler) is called. 5. When the program terminates, the args array is deleted from DYNAMIC storage. 6. When the program terminates, the main() method is removed from STATIC memory. 7. The println() method is being called in some object in DYNAMIC memory whos address is in the "out" field which is in STATIC memory. 8. If a command line parameter is not provided when this program is started it will print "null" or blanks as the name.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
