What are the OOPS Concept in JAVA? Do you explain that Concept .
Q. What are the OOPS Concept in JAVA? Do you explain that Concept .
Ans :- OOPS stands for (Object oriented programming system)
=> The process of constructing programs using class-object concept is known as object-oriented programming.
These are OOPS Concepts-
1.Object
2.Class
3.Inheritance
4.Polymorphism
5.encapsulation
6.Abstraction.
1.Object-
=> Object is a instance of a Class.
=> Object is a storage releated to a class holding instance member of a class.
=>We use "new " keyword in creating Objects.
=>Object is created in Heap Area of JVM.
=>Object will hold instance member of class.
2.Class:-
=> Class is a structured Layout generating Object.
=> Class is a user defined datatype
=> Class is a Collection of variables, methods, blocks and constructor.
3.Inheritance:-
=> Inheritance in JAVA is a mechanism in which one object acquires all the properties and behavior of a parent object is known as Inheritance process.
=>The process of extracting the features from one class into another class is known as Inheritance process.
Types of Inheritance-
1.Single Inheritance
2.Multiple Inheritance
3.Multi-Level Inheritance
4.Hierarchal Inheritance
5.Hybrid Inheritance
4.Polymorphism:-
=> Polymorphism in java is a concept by which we can perform a single action indifferent ways. Polymorphism is derived from 2 greek word : "Poly " and "morphs" means forms. so polymorphism means many forms.
There are two types of polymorphism in JAVA-
1. Compile-time Polymorphism (Method Overloading)
2. Rum-time Polymorphism (Method Overriding)
5.encapsulation:-
=> binding the data member and member function into the single unit is known as encapsulation
=>The process of binding the All the programming components into a single-unit Class is known as encapsulation process
6.Abstraction:-
=>Hiding the implementation details and showing only functionality to the user is known as Abstraction
=>the process of hiding the background implementation from the end user is known as Abstraction process.
=>In java we use "Interfaces" and "AbstractClasses" to acheive Abstraction process.
Comments
Post a Comment