2.2 Interface in Java 3. Abstraction example 4. Abstraction vs Encapsulation 5. Conclusion 1. Introduction Abstraction is a concept of exposing only essential details and hiding implementation details. It is one of the essential OOPs concept apart from encapsulation, inheritance and polymorphism. Abstra...
5. Abstraction in Java Abstraction in Java is implemented throughinterfacesandabstract classes. They are used to create a base implementation or contract for the actual implementation classes.Car.java: Base interface or abstract class package com.journaldev.oops.abstraction; public interface Car { void...
public void turnOffCar() { System.out.println("turn off the manual car"); } @Override public String getCarType() { return this.carType; } } package com.journaldev.oops.abstraction; public class AutomaticCar implements Car { private String carType = "Automatic"; @Override public void turnO...
Hi, may I seek a clarification about generalization concept. Let’s say I have a two kinds of staff, Manager and Supervisor and both have the same attributes (name,contact number). So, is it possible to say that this has a generalization relationship – Staff as the superclass, Manager a...
Java Interview Questions SQL Interview Questions Sonata(65) Analytical Ability Interview Questions C Interview Questions TCS(396) Aptitude Interview Questions C FAQs COBOL Interview Questions Critical Reasoning Questions Quantitative Aptitude Questions