Java basically works on four basic OOPS concept and they are
1. Abstraction
2. Encapsulation
3. Polymorphism
4. Inheritance
Abstraction means incomplete. Abstraction in java can be achieved by use of interface or abstract class. Abstraction declares the functions, it doesn't define or provide the details how it will be used.
It can't be instantiated. The concrete class who will implement the interface or extend the abstract class has to implement the functionality of the function / method.
Encapsulations hides the data from external use. You can't access the data which are declared as private inside the class. By using encapsulation you are keeping data safe in Java.
Polymorphism stands for many forms one name. Method overriding and method overloading are considered to be part of polymorphism concept.
Acquiring parent's properties within child class is called Inheritance in java. Its like parent-child relationship. Extending a class / interface is inheritance in Java.
More detailed posts regarding oops concept can be found in my blogs. I have explained it with real time examples in some of them.
1. Abstraction
2. Encapsulation
3. Polymorphism
4. Inheritance
Abstraction means incomplete. Abstraction in java can be achieved by use of interface or abstract class. Abstraction declares the functions, it doesn't define or provide the details how it will be used.
It can't be instantiated. The concrete class who will implement the interface or extend the abstract class has to implement the functionality of the function / method.
Encapsulations hides the data from external use. You can't access the data which are declared as private inside the class. By using encapsulation you are keeping data safe in Java.
Polymorphism stands for many forms one name. Method overriding and method overloading are considered to be part of polymorphism concept.
Acquiring parent's properties within child class is called Inheritance in java. Its like parent-child relationship. Extending a class / interface is inheritance in Java.
More detailed posts regarding oops concept can be found in my blogs. I have explained it with real time examples in some of them.
No comments:
Post a Comment