Understanding java Utilities In this exercise assume you hav
Understanding java Utilities In this exercise, assume you have written a Java program and stored your source code in a file named MyJavaProgram. java. Then, answer Questions 1-3. What is the name of the class stored in this file? What command would you use to compile the source code? What command would you use to execute the program?
Solution
Answer:
1) a class, interface, enumeration, or annotation type in a text file whose name is the simple name of the type and whose extension is .java
MyJavaProgram.java// class name MyJavaProgram
2) You will use the javac command to compile
the program\'s Java source code must be compiled into byte-code using the javac compiler.
% javac -g MyJavaProgram.java
3)You will use the java command to execute your program.
