Many languages claim to be Object-Oriented. While the exact definition of the term is highly variable depending upon who you ask, there are several qualities that most will agree an Object-Oriented language should have:
1. Encapsulation/Information Hiding

2. Inheritance

3. Polymorphism/Dynamic Binding

4. All user-defined types are Objects

For the purposes of this discussion, a language is considered to be a “pure” Object-Oriented languages if it satisfies all of these qualities. A “hybrid” language may support some of these qualities, but not all. In particular, many languages support the first three qualities, but not the final three.Actually speaking, java is not a completely OOP’s language, because Java still supports primitive data types like int,float…, so java is may called as 99% OOP’s language.
Object-Oriented Programming Language nothing but, objects are the key things here, objects talk each other. OO programming is designed so that real world concepts can be modeledin a computer program. Object-oriented programming thinks of real world things as objects.Objects have two parts to them, data and operations which can be carried out on this data.

The first step in OOP is to identify all the objects you want to manipulate and how they relate to each other, an exercise often known as data modeling. Once you’ve identified an object, you generalize it as a class of objects (think of Plato’s concept of the “ideal” chair that stands for all chairs) and define the kind of data it contains and any logic sequences that can manipulate it. Each distinct logic sequence is known as a method. A real instance of a class is called (no surprise here) an “object” or, in some environments, an “instance of a class.” The object or class instance is what you run in the computer. Its methods provide computer instructions and the class object characteristics provide relevant data. You communicate with objects – and they communicate with each other – with well-defined interfaces called messages.

Encapsulation:Encapsulation is an important part of OO programming, but it’s notdifficult. In Java Encapsulation is implemented by a class, all a class is the generic form of an object.Methods and instance variables can bepublic or private. If a method is private it can only be accessed bycode within the implementation of the class, while private instance variables can only be accessed from within the class. Public methodsand instance variables can be accessed from any class.

Inheritance:Inhertiance is a relatively simple concept which allows code defined in one class to be reused in other classes.In java, you can define a superclass, and then extend it with more specific subclasses.Inheritence is used to*promote code reuse*To use polymorphism

Polymorphism:Polymorphism is the ability of objects to react differently when presented with different information, known as parameters. In a functional programming language the only way to complete two different tasks is to have two functions with different names. Object-orientedlanguages like Java, allow different methods to be run depending on what type of parameters (its called signatures)are specified.Polymorphism is the capability of an action or method to do different things based on the object that it is acting upon. This is the third basic principle of object oriented programming. Overloading, overriding and dynamic method binding are three types of polymorphism.
Overridden methods are methods that are redefined within an inherited or subclass. They have the same signature and the subclass definition is used.

Overloaded methods are methods with the same name signature but either a different number of parameters or different types in the parameter list.

Dynamic (or late) method binding is the ability of a program to resolve references to subclass methods at runtime,More about Dyanamic binding will explained in later topics.

Advertisements