Q1. What is the difference between an interface and an abstract class?
- An interface declares a contract. It supports abstract methods plus default and static methods (Java 8+), private methods (Java 9+) and constants. A class can implement...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (14 available).
- An interface declares a contract. It supports abstract methods plus default and static methods (Java 8+), private methods (Java 9+) and constants. A class can implement...
Both describe the shape of an object, with subtle differences: - interface supports declaration merging and is usually preferred for public object shapes and class contra...
An interface declares a contract: a set of method signatures with no state that any type can implement. A class can implement many interfaces, which models capability. An...
Polymorphism lets one interface be used by many implementations, so callers depend on a contract rather than a concrete type. Subtype or runtime polymorphism: a base refe...
An interface is a set of method signatures. Any type that implements all of them satisfies the interface implicitly, with no `implements` keyword. Internally an interface...
Depend on an abstraction and let each shape compute its own values. ```java interface Shape { double area(); double perimeter(); } class Circle implements Shape { private...
Both define contracts that other types implement, but they differ in intent and mechanics. - An interface declares a contract with no state (traditionally) and supports m...
`const` is a compile-time contract. A `const` object cannot be modified, and a `const` member function promises not to modify the object, so it can be called on const obj...
The Dependency Inversion Principle has two parts: high-level policy should not depend on low-level detail, and abstractions should not depend on details; details should d...
In TypeScript, custom types can be defined using interfaces or type aliases. Interfaces define the structure of an object and can be implemented by classes, while type al...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.