Skip to content
javabypankaj
HomeLibraryPopularCommunity
02
OOPs
9 topics · 32 questions
1OOPs Fundamentals0/442Encapsulation & Cohesion0/223Abstraction & Interfaces0/44Inheritance0/335Polymorphism0/776Object Class & Constructors0/557Relationships: Association, Aggregation, Composition0/338Coupling & Design0/229Modern Java OOP: Records & Sealed0/22
1OOPs Fundamentals42Encapsulation & Cohesion23Abstraction & Interfaces44Inheritance35Polymorphism76Object Class & Constructors57Relationships: Association, Aggregation, Composition38Coupling & Design29Modern Java OOP: Records & Sealed2
9 topics32 Qs0%
01Core Java17002OOP3203Collections6704Exception Handling2805Concurrency & Multithreading12706Java Streams, Lambda & Functional Programming32807Spring & Spring Boot2608Transactions3209JPA & Hibernate6910Microservices19411Kafka & Messaging9112DevOps, CI/CD & Tooling13313Database & SQL14114REST API & Web4015Design Patterns & LLD5716Advanced Java7117Coding Problems: DSA49218AWS & Cloud4119Data Engineering19420QA, Testing & SDET4121System Design3522Security2023Behavioral / HR: STAR Method37
9Topics
32Questions
0%Complete
3 of 9 topics
Topics
1OOPs Fundamentals0/442Encapsulation & Cohesion0/22
3Abstraction & Interfaces0/44
4Inheritance0/335Polymorphism0/776Object Class & Constructors0/557Relationships: Association, Aggregation, Composition0/338Coupling & Design0/229Modern Java OOP: Records & Sealed0/22

Abstraction & Interfaces

OOPs·Topic 3 of 9·4 questions
Q1What is the difference between abstract class and interface?

Interface provides a contract with multiple inheritance and no state. Abstract class provides partial implementation with single inheritance and can have state and constructors. Prefer interface unless you need shared mutable fields.

Read Answer
Q2Can an abstract class extend another class and implement interfaces?

Yes: an abstract class can extend one class (abstract or concrete) and implement multiple interfaces simultaneously. It can leave interface methods unimplemented for concrete subclasses. The concrete child at the bottom must implement all remaining abstract methods.

Read Answer
Q3Can you instantiate an abstract class?

new AbstractClass() is a compile error. new AbstractClass() { implement abstract methods here } creates an anonymous subclass. Lambda replaced anonymous for single-method interfaces. Anonymous is still needed for abstract classes and multi-method interfaces.

Read Answer
Q4When do you choose interface vs abstract class?

Interface for capability contracts (multiple inheritance, no state). Abstract class for family hierarchies (shared state, constructors). Java 8 default methods help but still no constructors, no instance fields, no protected methods.

Read Answer
Previous · Topic 2Encapsulation & Cohesion2 questionsNext · Topic 4Inheritance3 questions
javabypankaj© 2026 javabypankaj
PrivacyTerms
HomeSearchLibrary