Tuesday, April 10, 2007

What is a Class?

A class is a collection of attributes and behaviors of objects with certain similarities and an instance of a class is represented by an object.A simple example of class is a 'Car' which represents variety of Car objects with different attribute values and behaviors.The different objects of 'Car' class can be, for example : A Mercedes Car,a Toyota Car, two different objects from same class but different attributes and different behaviors too.

2 comments :

Dinesh on June 16, 2010 at 12:11 PM said...

A class is a blueprint for the particular type of objects. Class describes how the objects of the class looks like and what will be the attributes and the operation a object can do.

Nishanth Thomas ,Bangalore said...

A class is a collection of objects of similar type. A class is a user defined data type.Classes are primary and essential elements of java program.Classes are used to represent real world problems.

 

Disclaimer
Interview Questions On Java,Java EE Copyright © 2016. Reads: best tracker