Java OOP Concepts 1



Below I have listed a few points of general OOP concepts. In future I will explain each of these with individual articles.

01. Simula is the first oo language
02. Smalltalk is the first true OO lang
03. Object
Object is an entity which has state and behavior.

04. Class
Class is a collection of objects.

------ OOP Concepts ---------------------------
05. Inheritance
* If a class acquire all properties and behaviors of super class then inheritance happened there.

class Super {
  .....
  .....
}
class Sub extends Super {
  .....
  .....
}

06. Abstraction
* Hiding internal details when interact with public world it is called abstraction.
* Abstract classes achieves abstraction
* Interface achieves abstraction.

07. Encapsulation - Data Hiding
* Wrapping all data into one object/unit is called encapsulation.
* In encapsulation, the variables of a class will be hidden from other classes
* To do this
* Declare private variables.
* Provide public getters and setters to access or modify data.

* Pros
* The fields of a class can be made read-only or write-only.
* Have control for field values.
08. Polymorphism
* Means many form of same method but various functions or processes
* Run time polymorphism
* OVERRIDING
* Compile time polymorphism
* OVERLOADING
------ OOP Concepts ---------------------------




Comments

Popular Posts