Exam 8: Polymorphism and Abstract Classes
Exam 1: Getting Started45 Questions
Exam 2: Console Input and Output29 Questions
Exam 3: Flow of Control44 Questions
Exam 4: Defining Classes I45 Questions
Exam 5: Defining Classes II46 Questions
Exam 6: Arrays46 Questions
Exam 7: Inheritance43 Questions
Exam 8: Polymorphism and Abstract Classes43 Questions
Exam 9: Exception Handling45 Questions
Exam 10: File IO46 Questions
Exam 11: Recursion44 Questions
Exam 12: Uml and Patterns22 Questions
Exam 13: Interfaces and Inner Classes32 Questions
Exam 14: Generics and the Arraylist Class32 Questions
Exam 15: Linked Data Structures43 Questions
Exam 16: Collections,maps,and Iterators44 Questions
Exam 17: Swing I37 Questions
Exam 18: Swing II31 Questions
Exam 19: Java Never Ends26 Questions
Exam 20: Applets25 Questions
Select questions type
You cannot create an object using a/an:
Free
(Multiple Choice)
4.7/5
(41)
Correct Answer:
D
An abstract class must have the modifier ___________ included in the class heading.
Free
(Multiple Choice)
4.8/5
(43)
Correct Answer:
B
Derive a class named Dress Shoes from the base class created in number 9 above.
Free
(Essay)
4.7/5
(40)
Correct Answer:
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)
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)
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)