|Explain the various features
of the Object Oriented Programming Language.
The object oriented principles are-
Encapsulation means the detailed implementation of a component which can be hidden from rest of the system. Encapsulation means binding of data and method together in a entity called class. The data inside that class is accessible by the function in the same class. It is normally not accessible from the outside of the component.
Inheritance is a property by which the new classes are created using the old classes. In other words the new classes can be developed using some of the properties of old classes.
The old classes are referred as base classes and the new classes are referred as derived classes. That means the derived classes inherit the properties of base class.
As shown below example the shape is a base class from which the circle, line, and rectangle are the derived classes. These classes inherit the functionality draw() and resize(). Similarly, the rectangle is a base class for the derived class square.
Polymorphism is the ability to take more than one form and refers to an operation exhibiting different behavior instances. Object oriented programs use polymorphism to carry out the same operation in a manner customized to the object. Without polymorphism, you should have to create separate module names for a each method.
For example the method clean is used to clean a Dish object,
one that cleans a car object, and one that cleans a vegetable object.
4. Dynamic Binding
Binding refers to the linking of a procedure call to the
code to be executed in response to the call. In static binding which function
is to be called for a particular object is determined at the compile time.
Selection of particular function for call is
Dynamic binding is a kind of binding in which it is decided at run time which function should be associated with a particular class or a object. In dynamic binding a function is declared virtual in order to instruct compiler that the code being generated for it is of type dynamic binding type. In dynamic binding the code associated with a given procedure call is not known until the time of the call at run-time.
Ask It in The Java Forum
Return to : Java Programming Hints and Tips
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.