Abstract Class in Java MCQs

@T-Bone

This question paper focuses on the "Abstract Class" of the Java programming. These Multiple Choice Questions (mcq) should be practiced to improve the Java programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

This question paper focuses on the "Abstract Class" of the Java programming. These Multiple Choice Questions (mcq) should be practiced to improve the Java programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

Questions

1. A class which is declared with the ________ keyword is known as an abstract class in Java.

Mark the correct option

2. Abstract class can have constructors and static methods?

Mark the correct option

3. What is the syntax of abstract class in java?

Mark the correct option

4. Which of these is not abstract?

Mark the correct option

5. A method which is declared as abstract and does not have implementation is known as an _____________?

Mark the correct option

6. Which of these packages contains abstract keyword?

Mark the correct option

7. An abstract class can have a data member, abstract method, method body (non-abstract method), constructor, and even main() method.

Mark the correct option

8. Which of these is not a correct statement?

Mark the correct option

9. What will be output for the folllowing code? abstract class Bank { private abstract void withdraw(); // Line 1 abstract void deposit(); public void balance(){} //Line 2 } class office extends Bank{ // Line 3 void deposit() { // Line 4 // TODO Auto-generated method stub } }

Mark the correct option

10. What will be output for the folllowing code? abstract class Bank { private String bankName; Bank(String bankName) { this.bankName = bankName; } public String getBankName() { return bankName; } } class office extends Bank { office() { super("Axis Bank"); } public static void main(String[] args) { Bank bank = new office(); System.out.println(bank.getBankName()); } }

Mark the correct option

Index of Questions