Blogger templates

Your Ad Here

Video

Blogroll

Blogger news

Class Based Object Oriented Programming


A class is the implementation of an abstract data type (ADT). It defines attributes and methods which implement the data structure and operations of the ADT, respectively. Instances of classes are called objects. Consequently, classes define properties and behaviour of sets of objects
Class-based programming, or more commonly class-orientation, refers to the style of object-oriented programming in which inheritance is achieved by defining classes of objects, as opposed to the objects themselves.

 

For example : 

 

Class fruit {

       String colour;

       String taste; 

       String getTaste(); 

}



Here fruit is a class with color and  taste are the attributes and getTaste() is the method for getting the taste of the fruit. Here the class has a self existence and a meaning of its own. That is what object oriented concept means.


Class-based model, as opposed to an object-based model, is the most popular and developed model of OOP. In this model, objects are entities that combine state (i.e., data), behavior (i.e., procedures, or methods) and identity (unique existence among all other objects). The structure and behavior of an object are defined by a class, which is a definition, or blueprint, of all objects of a specific type. An object must be explicitly created based on a class and an object thus created is considered to be an instance of that class. An object is similar to a structure, with the addition of method pointers, member access control, and an implicit data member which locates instances of the class (i.e. actual objects of that class) in the class hierarchy (essential for runtime inheritance features). 


 

 

Most Reading

Stats