Question: QUESTION 1 Each class must be declared in its own .java file True or False? QUESTION 2 The keyword this must always be explicitly used

QUESTION 1

  1. Each class must be declared in its own .java file

    True or False?

QUESTION 2

  1. The keyword this must always be explicitly used when referring to an object's instance variables and methods from within one of its non-static methods.

    True or False?

QUESTION 3

  1. When used in a class' main method the this keyword references the object representing the class itself.

    True or False?

QUESTION 4

  1. Accessor methods that test whether a condition is true or false are often called predicate methods.

    True or False?

QUESTION 5

  1. A class that holds references to objects of other classes as members demonstrates composition (a has-a relationship).

    True or False?

QUESTION 6

  1. The following code creates a new instance of the Pixel enum and assigns it to myPixel:

    enum Pixel {RED, GREEN, BLUE}

    // ...

    Pixel myPixel = new Pixel();

    True or False?

QUESTION 7

What does the following code display?

enum Pixel {RED, GREEN, BLUE}

// ...

public static void main(String args[]) {

for (Pixel px : Pixel.values()) {

System.out.print(px);

}

}

QUESTION 8

  1. A program might be terminated before the JVM's garbage collector has been executed.

    True or False?

QUESTION 9

  1. The following import statement allows the class that contains it to access all static members of the java.lang.Math class by their unqualified names (e.g.: double piVal = PI;)

    import static java.lang.Math.*;

    True or False?

QUESTION 10

  1. Variables with constant values (those that cannot be modified once initialized) are declared with the keyword ______.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!