Skip to main content

Interfaces And Abstract Classes — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Interfaces And Abstract Classes — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

In Java, can an abstract class extend another class?

Question 2 of 40
★ FPSC ★ PPSC

interface Base{ boolean m1 (); byte m2(short s); } which two code fragments will compile? 1. interface Base2 implements Base {} 2. abstract class Class2 extends Base { public boolean m1(){ return true; }} 3. abstract class Class2 implements Base {} 4. abstract class Class2 implements Base { public boolean m1(){ return (7 > 4); }} 5. abstract class Class2 implements Base { protected boolean m1(){ return (5 > 7) }}

Question 3 of 40
★ FPSC ★ PPSC

Which two of the following are legal declarations for abstract classes and interfaces? 1. final abstract class Test {} 2. public static interface Test {} 3. final public class Test {} 4. protected abstract class Test {} 5. protected interface Test {} 6. abstract public class Test {}

Question 4 of 40
★ FPSC ★ PPSC

What will happen after compiling this program code? abstract class MyClass{ //line 1 private int a, b; public void call(int a, int b){ this.a = a; this.b = b; System.out.print(a+b); } } public class Test{ public static void main(String args[]){ MyClass m = new MyClass(); //line 2 m.call(12,25); } }

Question 5 of 40
★ FPSC ★ PPSC

What is the output for the below code? interface A{ public void printValue(); } public class Test{ public static void main (String[] args){ A a1 = new A(){ public void printValue(){ System.out.println("A"); } }; a1.printValue(); } }

Question 6 of 40
★ FPSC ★ PPSC

What will be the output? public interface InfA{ protected String getName(); } public class Test implements InfA{ public String getName(){ return "test-name"; } public static void main (String[] args){ Test t = new Test(); System.out.println(t.getName()); } }

Question 7 of 40
★ FPSC ★ PPSC

What will be the output for the below code? public interface TestInf{ int i =10; } public class Test{ public static void main(String... args){ TestInf.i=12; System.out.println(TestInf.i); } }

Question 8 of 40
★ FPSC ★ PPSC

What will be the output when the following program is compiled and executed? abstract class TestAbstract{ String my_name; String myName(){ my_name = "Examveda"; return my_name; } abstract void display(); } public class Test extends TestAbstract{ void display(){ String n = myName(); System.out.print("My name is "+ n); } public static void main(String args[]){ Test t = new Test(); t.display(); } }

Question 9 of 40
★ FPSC ★ PPSC

What happens if the following program is compiled and executed? interface MyInterface{ void display(); } interface MySubInterface extends MyInterface{ void display(); } public class Test implements MySubInterface{ public void display(){ System.out.print("Welcome to Examveda."); } public static void main(String args[]){ Test t = new Test(); t.display(); } }

Question 10 of 40
★ FPSC ★ PPSC

What is an interface in Java?

Question 11 of 40
★ FPSC ★ PPSC

In Java, can a class implement multiple interfaces?

Question 12 of 40
★ FPSC ★ PPSC

Which keyword is used to declare an interface in Java?

Question 13 of 40
★ FPSC ★ PPSC

What is the purpose of an abstract class in Java?

Question 14 of 40
★ FPSC ★ PPSC

In Java, can an abstract class be instantiated?

Question 15 of 40
★ FPSC ★ PPSC

What is the purpose of the "implements" keyword in Java?

Question 16 of 40
★ FPSC ★ PPSC

Which of the following can contain both abstract and non-abstract methods?

Question 17 of 40
★ FPSC ★ PPSC

In Java, can an interface have fields (member variables)?

Question 18 of 40
★ FPSC ★ PPSC

What is the purpose of an abstract method in an abstract class or interface?

Question 19 of 40
★ FPSC ★ PPSC

Which keyword is used to define an abstract method in Java?

Question 20 of 40
★ FPSC ★ PPSC

In Java, can an interface have private methods with implementations?

Question 21 of 40
★ FPSC ★ PPSC

What is the result of the following code snippet? interface MyInterface { void myMethod(); } public class MyClass implements MyInterface { public void myMethod() { System.out.println("Implementation"); } public static void main(String[] args) { MyInterface obj = new MyClass(); obj.myMethod(); } }

Question 22 of 40
★ FPSC ★ PPSC

What is the purpose of the "extends" keyword in Java?

Question 23 of 40
★ FPSC ★ PPSC

In Java, can an interface extend another interface?

Question 24 of 40
★ FPSC ★ PPSC

What is the result of the following code snippet? abstract class MyAbstract { abstract void myMethod(); } class MyClass extends MyAbstract { void myMethod() { System.out.println("Implementation"); } public static void main(String[] args) { MyAbstract obj = new MyClass(); obj.myMethod(); } }

Question 25 of 40
★ FPSC ★ PPSC

In Java, can an abstract class have non-abstract methods?

Question 26 of 40
★ FPSC ★ PPSC

What is the purpose of the "default" keyword in Java interfaces?

Question 27 of 40
★ FPSC ★ PPSC

What is the result of the following code snippet? interface MyInterface { default void myMethod() { System.out.println("Default Implementation"); } } class MyClass implements MyInterface { public static void main(String[] args) { MyInterface obj = new MyClass(); obj.myMethod(); } }

Question 28 of 40
★ FPSC ★ PPSC

In Java, can a class implement an interface and extend an abstract class simultaneously?

Question 29 of 40
★ FPSC ★ PPSC

What is the purpose of the "final" keyword in Java?

Question 30 of 40
★ FPSC ★ PPSC

In Java, can an abstract class have constructors?

Question 31 of 40
★ FPSC ★ PPSC

What is the result of the following code snippet? abstract class MyAbstract { MyAbstract() { System.out.println("Constructor"); } } class MyClass extends MyAbstract { public static void main(String[] args) { MyClass obj = new MyClass(); } }

Question 32 of 40
★ FPSC ★ PPSC

In Java, can an interface have static methods with implementations?

Question 33 of 40
★ FPSC ★ PPSC

What is the result of the following code snippet? interface MyInterface { static void myMethod() { System.out.println("Static Method"); } } class MyClass implements MyInterface { public static void main(String[] args) { MyInterface.myMethod(); } }

Question 34 of 40
★ FPSC ★ PPSC

In Java, can an abstract class have private methods with implementations?

Question 35 of 40
★ FPSC ★ PPSC

What is the result of the following code snippet? abstract class MyAbstract { private void myMethod() { System.out.println("Private Method"); } } class MyClass extends MyAbstract { public static void main(String[] args) { MyClass obj = new MyClass(); obj.myMethod(); } }

Question 36 of 40
★ FPSC ★ PPSC

In Java, can an abstract class have static methods with implementations?

Question 37 of 40
★ FPSC ★ PPSC

What is the result of the following code snippet? abstract class MyAbstract { static void myMethod() { System.out.println("Static Method"); } } class MyClass extends MyAbstract { public static void main(String[] args) { MyAbstract.myMethod(); } }

Question 38 of 40
★ FPSC ★ PPSC

In Java, can an abstract class have default methods with implementations?

Question 39 of 40
★ FPSC ★ PPSC

Given the following piece of code: public class School{ public abstract double numberOfStudent(); } which of the following statements is true?

Question 40 of 40
★ FPSC ★ PPSC

Which of the following class definitions defines a legal abstract class?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →