Quiz


1.  

What is abstraction?

abstraction is a way for the programmer of a super class to require the programmer of a subclass to define a method.

2.  

When should abstraction be used in a program?

abstraction should be used in a program when there isn t any way to define a good default method in the super class.

3.  

What is an abstract method?

an abstract method is a method defined in a super class that must be redefined in a subclass that inherits the super class.

4.  

Can an abstract method be called within a program?

an abstract method cannot be called within a program.

5.  

What happens if an abstract method is not redefined?

a compiler error occurs if an abstract method is not redefined.

6.  

Can an instance of an abstract class be declared in a program?

an instance of an abstract class cannot be declared in a program.

7.  

Can an abstract method be called directly by a subclass?

an abstract method cannot be called directly by a subclass.

8.  

Must an abstract method be redefined by a subclass?

a programmer of a subclass that inherits an abstract super class must redefine the abstract methods defined in the subclass, even if those methods are not called within the application.

9.  

Must all methods in an abstract class be designated as abstract?

a super class can contain a mixture of abstract methods and non-abstract methods.

10.  

Must all methods in an abstract class be redefined in a subclass?

only abstract methods must be redefined in a subclass that inherits from the abstract super class.

Answers

1.  

Abstraction is a way for the programmer of a super class to require the programmer of a subclass to define a method.

2.  

Abstraction should be used in a program when there isn t any way to define a good default method in the super class.

3.  

An abstract method is a method defined in a super class that must be redefined in a subclass that inherits the super class.

4.  

An abstract method cannot be called within a program.

5.  

A compiler error occurs if an abstract method is not redefined.

6.  

An instance of an abstract class cannot be declared in a program.

7.  

An abstract method cannot be called directly by a subclass.

8.  

A programmer of a subclass that inherits an abstract super class must redefine the abstract methods defined in the subclass, even if those methods are not called within the application.

9.  

A super class can contain a mixture of abstract methods and non-abstract methods.

10.  

Only abstract methods must be redefined in a subclass that inherits from the abstract super class.




OOP Demystified
OOP Demystified
ISBN: 0072253630
EAN: 2147483647
Year: 2006
Pages: 130

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net