Java oops concepts

Object-Oriented Programming:

                                OOPs is a programming language using  objects and classes instead of actions and rather than logic.
                                Java is an object-oriented programming language.

OOPs concepts in java:


    1.       Object
    2.       Class
    3.       Inheritance
    4.       Encapsulation
    5.       Abstraction
    6.       Interface
    7.       Polymorphism
8.       Package

Object-Oriented Programming Concepts diagram

Object:
                                 An object is a software bundle of related methods and variables. The object is an instance of the class the real-world objects that you find in everyday life.
Ex: Bus,Car,Phone.
More about object

Class:
                                A class is a blueprint it has state and behavior . A class is a logical entity.
State: states means properties of class.
Behavior: Behavior means functionalities of a class.
More about class
Inheritance:
                               Acquiring features from the super-class (parent class) to subclass(child class) is known as inheritance. In  java  inheritance is achieved by using of extends keyword. Inheritance provides Code re-usability.

More about inheritance
Encapsulation:
                                A collection of similar type of data & methods are protective in a single class with required access modifiers, so that can be saved from unauthorized access.
More about encapsulation
Abstraction:                               
                                An abstraction  is a process of hiding internal details and showing only functionality is known as abstraction.
Example: Computer

Interface:
                                An interface is a collection of abstract methods. It is a blueprint of a class. It contains abstract methods and final variables. By using interface 100% abstraction is achieved.

More about interface
Polymorphism:
                                One object existing in many forms is known as polymorphism. In java, there are two types of polymorphisms.

Package:
                                A package is a namespace it contains a group of similar types of classes, interfaces, sub-classes. To overcome naming space packages are very helpful.
More about packages


Interview Questions:

Explain about oops concepts?
What is inheritance?
What is Encapsulation?
Why we use packages?
What is an object in java?
What is polymorphism?          
What is abstraction and how we can achieve 100% abstraction in java?

6 comments

Good work sir, Thanks for the proper explanation about Inheritance . I found one of the good resource related JAVA and OOPS concepts. It is providing in-depth knowledge on JAVA and OOPS. which I am sharing a link with you where you can get more clear on JAVA and OOPS. To know more Just have a look at this link

Java Tutorial
Class and object
Inheritance
Polymorphism
Abstraction
Encapsulation

Hi,
Thanks for sharing the info about JAVA Plz keep sharing on...
Thank you...

I really liked your article , your article is very
petrified me in the learning process and provide
additional knowledge to me , maybe I can learn
more from you. I really enjoy reading your post and I collect some idea on oops concepts


EmoticonEmoticon