Visitor Counter

Fat Burning

Thursday, May 7, 2015

OOPS Concept in Java - Example Tutorial

Hi Guy’s
So this blog is all regarding the OOPS concepts. Let’s start from the very basic concept of Object and Class.

More On Concepts

  1. Introduction
  2. Inheritance
  3. Polymorphism
  4. Encapsulation

What is an Object?
An object is a software collection of related state and performance.
Software objects are regularly used to model the real-world objects that you find in daily life. Real-world substance share two individuality: They all have state and behavior.

Some examples of real world object can be : Bike , Chair , Dogs, have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail).

Software objects are theoretically comparable to real-world objects:
They too consist of state and connected behavior.An object stores its state in fields (variables in some programming languages) and exposes its performance through methods (functions in a few programming languages).

Methods function on an object’s inside state and serve as the primary device for object-to-object message.

Defeat inside state and requiring all communication to be performed through an object’s methods is known as ( data encapsulation — a fundamental principle of OOP )

What Is a Class?
A class is a blueprint or example from which objects are produced.

What Is Inheritance?
Inheritance provides a great and natural device for organizing and structuring your software.

How to achieve Inheritance in Java ?
extends keyword is used to inherit features of a class.


What Is an Interface?
An interface is a deal between a class and the external world.
When a class tools an interface, it promises to provide the behavior published by that interface. 

What Is a Package?
A package is a namespace for organizing classes and interfaces in a logical manner.
Placing your code into packages makes large software projects easier to manage.



No comments:

Post a Comment