Loading

Q1.

Which keyword is used to declare an abstract class in Java?

A. class
B. abstract
C. interface
D. extends

Q2.

Can we create an object of an abstract class directly in Java?

A. Yes

B. No
C. Only if it has no abstract methods
D. Only in Java 11 and above

Q3.

 Which of the following provides 100% abstraction in Java (before Java 8)?

A. Abstract class

B. Interface

C. Concrete class
D. Static class

Q4.

What happens if a class contains an abstract method but is not declared abstract?

A. Compiles successfully

B. Runtime error

C. Compile-time error

D. Treated as interface

Q5.

 Which of the following statements is true about abstraction in Java?

A. Abstraction means showing implementation details to the user

B. Abstract class can have both abstract and concrete methods

C. An interface can have constructors

D. Abstraction is achieved only through abstract classes