<< Chapter < Page | Chapter >> Page > |
True or False? The execution of a Java application begins and ends in the method named main .
True or False? The two commands shown in Listing 4 can be used to compile and execute a Java application named Prob01 where:
Listing 4 . Question 12. |
---|
javac -cp .;---\bookClasses Prob01.java
java -cp .;---\bookClasses Prob01 |
True or False? The Java compiler program is named java.exe .
True or False? The Prob01.java and Prob01 at the ends of the two commands in Listing 4 specify the files being operated on by the virtual machine and the compilerrespectively.
True or False? In Listing 4 , the -cp indicates that a classpath follows.
True or False? A classpath consists of one or more path specifications separated by semicolon characters.
True or False? The purpose of the classpath in Listing 4 is to tell the compiler and the virtual machine where to look for source codefiles that the application needs in order to successfully compile and execute.
True or False? The period ahead of the semicolon in Listing 4 says to search the root folder first.
True or False? The first statement in the body of the main method in Listing 1 instantiates a new object of the class named Prob01Runner .
True or False? The first statement in Listing 1 saves a reference to a new object of the class named Prob01Runner in a reference variable named obj . In general, the type of the variable must be:
True or False? In Java, you must save a reference to a newly instantiated object in order to gain access to that object later in the program.
True or False? The second statement in the body of the main method in Listing 1 uses the reference stored in the variable named obj to call the method named run encapsulated in the object referred to by the contents of obj .
True or False? The following three methods that are called in Listing 1 are of a type that is commonly referred to as accessor methods . They are also sometimes referred to by the slang term getter methods .
True or False? The method named println that is called in Listing 1 is a member of Ericson's multimedia library. The purpose of the println method is to display text on an image.
True or False? Java uses four access modifiers to specify the accessibility of various classes and members in a Java application:
True or False? Listing 5 shows the beginning of a class named Prob01Runner .
Listing 5 . Question 26. |
---|
class Prob01Runner{
//Instantiate the World and Turtle objects.private World mars = new World(300,274);
private Turtle joe = new Turtle(mars);private Turtle sue = new Turtle(mars); |
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?