Exam 8: Polymorphism and Abstract Classes

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

You cannot create an object using a/an:

Free
(Multiple Choice)
4.7/5
(41)
Correct Answer:
Verified

D

An abstract class must have the modifier ___________ included in the class heading.

Free
(Multiple Choice)
4.8/5
(43)
Correct Answer:
Verified

B

Derive a class named Dress Shoes from the base class created in number 9 above.

Free
(Essay)
4.7/5
(40)
Correct Answer:
Verified

public class DressShoe extends Shoe
{
private String type;//valid types include pumps,heels and flats
public DressShoe)
{
super);
type = "";
}
public DressShoeString c,String d,double s,String t)
{
superc,d,s);
setTypet);
}
public void setTypeString t)
{
type = t;
}
public String getType)
{
return type;
}
public String toString)
{
return "Dress shoe designed by " + this.getDesigner)+
"\nColor: " + this.getColor)+ "\nSize: " +
getSize)+ "\n

Java uses late binding with private methods,methods marked final,or static methods.

(True/False)
4.8/5
(40)

Override the clone method inherited in the Dress Shoes class created in number 10 above.

(Essay)
4.9/5
(41)

The type of the variable naming an object determines which method names can be used in an invocation with that calling object.

(True/False)
4.8/5
(40)

An abstract method cannot be modified by:

(Multiple Choice)
4.9/5
(38)

Early binding enables the compiler to be more efficient.

(True/False)
4.9/5
(34)

The principals of object oriented programming include:

(Multiple Choice)
4.8/5
(37)

Describe the limitations of the copy constructor.

(Essay)
4.7/5
(44)

The final modifier is included before the definition of the method,then the method can be redefined in a derived class.

(True/False)
4.9/5
(42)

Java allows an instance of an abstract class to be instantiated.

(True/False)
4.8/5
(33)

What is an abstract method?

(Essay)
4.8/5
(34)

Derive a class named Boots from the base class created in number 9 above.

(Essay)
4.9/5
(37)

Why should the instanceOf operator be used in conjunction with downcasting?

(Essay)
4.9/5
(33)

__________ refers to the ability to associate many meanings to one method name by means of the late binding mechanism.

(Multiple Choice)
4.7/5
(42)

Override the clone method inherited in the Tennis Shoes class created in number 11 above.

(Essay)
4.9/5
(34)

Polymorphism refers to the ability to associate many meanings to one method through dynamic binding.

(True/False)
4.8/5
(40)

What are the advantages of polymorphism?

(Essay)
4.8/5
(34)

Assigning an object of a derived class to a variable of a base class is called:

(Multiple Choice)
4.9/5
(36)
Showing 1 - 20 of 43
close modal

Filters

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