Exam 11: Inheritance

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

If a class contains an abstract method,

(Multiple Choice)
4.8/5
(41)

If a subclass constructor does not explicitly call a superclass constructor,

(Multiple Choice)
5.0/5
(30)

Look at the following code.Which line will cause a compiler error? Line 1 public class ClassA Line 2 { Line 3 public ClassA(){} Line 4 public int method1(int a){} Line 5 public final int method2(double b){} Line 6 } Line 7 public ClassB extends ClassA Line 8 { Line 9 public ClassB(){} Line 10 public int method1(int b){} Line 11 public int method2(double c){} Line 12 }

(Multiple Choice)
4.8/5
(42)

If a method in a subclass has the same signature as a method in the superclass,the subclass method overloads the superclass method.

(True/False)
4.8/5
(36)

In the following statement,which is the interface? public class ClassA extends ClassB implements ClassC

(Multiple Choice)
4.9/5
(30)

All methods in an abstract class must also be declared abstract.

(True/False)
4.8/5
(40)

Every class has a toString method and an equals method inherited from the Object class.

(True/False)
4.8/5
(39)

All fields declared in an interface

(Multiple Choice)
4.8/5
(37)

A protected member of a class may be directly accessed by

(Multiple Choice)
4.9/5
(37)
Showing 41 - 49 of 49
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)