Posts

Showing posts from May, 2015

Four building blocks of Object oriented programming language

Four building blocks of Object oriented programming language Java is an object oriented programming language just like C++,small talk and python. An OOP language follows four basic rules: *Inheritance *Encapsulation *Polymorphism *Abstraction *Inheritance: The ability of a language to reuse previously written code and add further functionalities to the previously written code. How we use it in Java: BY EXTENDING CLASSES. Each child class inherits the functions and member variables from the parent class without even writing the whole code. *Encapsulation:  The ability of a language to  hide the important and private data and encapsulate into an single unit called "CLASS". How we use it in Java: By creating classes the data wrapped inside it and can only be accessed using the object(unless it is static data). *Polymorphism:  The ability of a language to  create a method with same name but multiple arguments each method do different work on different situation