
In ECET 2026 CSE, Object-Oriented Programming (OOP) in Java is a key area. Topics like Interfaces and Abstract Classes are often asked, as they test conceptual clarity about inheritance and polymorphism.
📘 Concept Notes
🔹 Abstract Classes
- A class declared with
abstract
keyword. - Can have both abstract methods (without body) and concrete methods (with body).
- Cannot be instantiated directly.
- Used when some common functionality is shared but implementation differs in subclasses.
👉 Example:
abstract class Animal {
abstract void sound(); // abstract method
void sleep() {
System.out.println("Sleeping...");
}
}
class Dog extends Animal {
void sound() {
System.out.println("Bark");
}
}
🔹 Interfaces
- A contract that defines only abstract methods (till Java 7).
- From Java 8, interfaces can have:
- Abstract methods
default
methods (with body)static
methods
- A class implements an interface using
implements
keyword. - Supports multiple inheritance (since a class can implement multiple interfaces).
👉 Example:
interface Vehicle {
void start(); // abstract method
default void fuel() {
System.out.println("Petrol/Diesel/Electric");
}
}
class Car implements Vehicle {
public void start() {
System.out.println("Car starts with key");
}
}
⚖️ Abstract Class vs Interface
Feature | Abstract Class | Interface |
---|---|---|
Methods | Can have abstract + concrete | Abstract (till Java 7), + default & static (from Java 8) |
Multiple Inheritance | Not supported | Supported |
Variables | Can have instance & static variables | Only public static final constants |
Usage | When classes share state + behavior | When classes share only behavior (contract) |
🔢 Formula (Theoretical – for understanding multiple inheritance resolution)
If:
- A class implements n interfaces each with m abstract methods,
- Then total methods to implement =
🔟 10 Expected MCQs – ECET 2026
Q1. An abstract class in Java:
A) Can be instantiated
B) Cannot be instantiated
C) Must have only abstract methods
D) None
Q2. Which keyword is used to create an abstract class?
A) virtual
B) abstract
C) interface
D) static
Q3. Which of the following supports multiple inheritance?
A) Abstract class
B) Interface
C) Both
D) None
Q4. Default methods in interface were introduced in:
A) Java 6
B) Java 7
C) Java 8
D) Java 9
Q5. Which keyword is used to implement an interface?
A) extends
B) implements
C) abstract
D) interface
Q6. If a class implements an interface, it must:
A) Override all abstract methods
B) Inherit variables
C) Extend another class
D) Be abstract itself
Q7. Which is TRUE for abstract class?
A) Can contain constructor
B) Cannot contain constructor
C) Cannot contain concrete methods
D) Must have no variables
Q8. Which is TRUE for interface variables?
A) They are instance variables
B) They are public static final
C) They are private
D) They are mutable
Q9. If a class implements 2 interfaces each having 3 abstract methods, total methods to implement = ?
A) 3
B) 6
C) 2
D) 5
Q10. Which is NOT possible in Java?
A) Class extending class
B) Class implementing interface
C) Interface extending interface
D) Class extending multiple classes
✅ Answer Key
Q.No | Answer |
---|---|
Q1 | B |
Q2 | B |
Q3 | B |
Q4 | C |
Q5 | B |
Q6 | A |
Q7 | A |
Q8 | B |
Q9 | B |
Q10 | D |
🧠 Explanations
- Q1 → B: Abstract classes cannot be instantiated.
- Q2 → B:
abstract
keyword is used. - Q3 → B: Only interfaces support multiple inheritance.
- Q4 → C: Default methods were introduced in Java 8.
- Q5 → B: Use
implements
keyword for interfaces. - Q6 → A: A class must override all abstract methods.
- Q7 → A: Abstract classes can have constructors.
- Q8 → B: All interface variables are
public static final
. - Q9 → B:
.
- Q10 → D: Java does not allow multiple class inheritance.
🎯 Why Practice Matters
- Interfaces & Abstract Classes are favorite ECET questions.
- They test conceptual clarity of OOP.
- Questions are direct, easy, and scoring.