Working With Abstract Class

Post Test

1) Can abstract classes have static methods(java)?

Yes,always
yes,depends on code
no,never
static members can't have different values

2) It is ......... to have an abstract method.
not mandatory for an static class
not mandatory for an derived class
not mandatory for an abstract class
not mandatory for an parent class

3) How many abstract classes can a single program contain?
Atmost 1
Atleast 1
Atmost 127
As many as required

4) Is it necessary that all the abstract methods must be defined from an abstract class?
Yes,depending on code
Yes,always
No,never
No,if function is not used.

5) Which of the following declares an abstract method in an abstract java class?
public abstract method();
public abstract void method();
public void method();
None

6) Which of the following statements regarding abstract classes are true.
An abstract class can be extended
A subclass of a non-abstract superclass can be abstract
An abstract class can be used as a data type
All of the above

7) In java,declaring a class abstract is useful......
To prevent developers from further extending the class
when it doesn't make sense to have objects of that class
Both A and B
None

8) Which of the following is used to make an Abstact class?
Making atleast one member function as pure virtual functions
Making atleast one member function as virtual functions
Declaring as Abstract class using virtual function
None

Number of score out of 8 = Score in percentage =