Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Java - Object Oriented Connection

Java - Object Oriented Connection

A brief introduction to the concept of object oriented programming and its main defining principles.

** This presentation is a part of the Java Tutorial series by RSpeaks **

RSpeaks

May 13, 2013
Tweet

More Decks by RSpeaks

Other Decks in Education

Transcript

  1. Programming Pattern Any program is composed of two main elements

    i.e. code & data. Primarily based on the elements there are two main patterns in which the program could be written – Process Oriented Pattern : is a linear step wise flow of writing a program. One code follows the next in steps. For e.g. C language uses this particular pattern. Object Oriented Pattern : this way of writing programs takes into consideration the data i.e. objects with an interface to it. For e.g. C++ and Java uses this particular pattern. 1
  2. 2 Object Oriented Programming Principles Abstraction Abstraction is a way

    to deal with complexity. It allows breaking down of complex systems into smaller manageable pieces. For e.g. we all drive cars unaware of the internal working parts. Thus we consider the car as a whole object rather than a compilation of different parts.
  3. Object Oriented Programming Principles Encapsulation The process of wrapping up

    data and code into a single entity is termed as encapsulation. This feature makes sure that the data is not directly accessible beyond the bounding entity (data hiding) but is accessible through the code that will access the data instead. 3
  4. Object Oriented Programming Principles Inheritance Deriving properties of one object

    by another object is termed as inheritance. It usually defines a hierarchy classification. Given an object A, if object B inherits object A, it not only copies the behavior and attributes of A but can also define its own special properties. Thus object B is a specialized object. A is called super object and B is called sub object. 4
  5. Object Oriented Programming Principles Polymorphism In its literal terms the

    term polymorphism means having many forms. This feature allows one interface to be used for a given set of common functions i.e. having one interface but multiple methods. For e.g. a dog can smell food, similarly he can also smell a cat and chase it. Though the output for smell is different the action of smelling is common in both. Thus we can define one common interface called smell but with completely different functionality. In non OOP programs this facility is not available, thus for each different action a different interface is required to be implemented. 5