Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MFDBS 89 2nd Symposium On Mathematical Fundamentals Of Database Systems Visegrad Hungary June 26 30 1989 Proceedings

Authors: Janos Demetrovics ,Bernhard Thalheim

1989th Edition

3540512519, 978-3540512516

More Books

Students also viewed these Databases questions

Question

=+3. What impediments deal with customers?

Answered: 1 week ago