Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 1 Given the following code, which compiles with no errors: A testA = ne

ID: 3757297 • Letter: Q

Question

Question 1

Given the following code, which compiles with no errors:

A testA = new A( );
B testB = testA;
C testC = testB;
Object o = testC;
// Point X

As the program is running, which of the following is true at "Point X"??

Question 2

Given these definitions:

class Oval {
void draw( ) { ... } //draws an oval
...
}

class Circle extends Oval {
void draw( ) { ... } //draws an empty circle
...
}

class Dot extends Circle {
void draw( ) { ... } //draws a filled circle
...
}

...what will be drawn by the following code?

Circle c = new Dot( );
Oval myOval = c;
myOval.draw( );

Question 3

Given this class definition:

class Monkey extends Mammal implements Noisy

...

Monkey m = new Monkey( );

Which of the following evaluates to true?

Question 4

If class Apple implements interface Edible, which of the following also true?

Question 5

What is always the very first thing that occurs in the constructor of a subclass?

Question 6

What is the difference between an abstract class and an ordinary class?

Question 7

Which of the following keywords may be used when declaring an instance variable to make that variable directly accessible to subclasses without making it accessible to other classes not located in the same package?

Question 8

Which of the following statements is true?

Question 9

Which of the following statements is true?

Question 10

Which of the following things would prevent a method declaration in a subclass from properly overriding an inherited method?

A. testC has static type C and dynamic type A

Explanation / Answer

Question 1 D. All of the above Question 2 C. a filled circle Question 3 D. All of the above Question 4 B. type Apple conforms to type Edible Question 5 C. a call to the superclass constructor is made Question 6 B. An abstract class cannot be instantiated. Question 7 B. protected Question 8 A. Objects NEVER change the class to which they belong. Question 9 A. If var1.equals(var2) is true, then var1==var2 must be true. Question 10 E. All of the above

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote