Difference between Interface and Abstraction

It’s a very good interview question “What are the main differences between Interface and Abstraction”, see that in the below video.

Example:

Output:
I am a
I am b
I am C
I am d

Please suggest us at online.nimit@gmail.com

Java Abstraction

In Object-oriented programming, abstraction is a process of hiding the implementation details from the user, only the functionality will be provided to the user

Example:

Output:
Flying…
Invisible…
Magic…

Please share the post if you like it. Email us at online.nimit@gmail.com if you have any queries.

OOPS – Inheritance

Inheritance is used for code-reusability. Inheritance is a mechanism wherein a new class is derived from an existing class. In Java, classes may inherit or acquire the properties and methods of other classes. A class derived from another class is called a subclass, whereas the class from which a subclass is derived is called a superclass.

1. Dog Class

2. Fish Class

3. Animal Class

4. Runner Class

Please share your feedback and share the post. Contact us at online.nimit@gmail.com