January 16, 2009 at 11:18 PM
Object : Objects are the basic run time entity or in other words object is a instance of a class . An object is a software bundle of variables and related methods of the special class. In the above example the sq is the object of square class and rect is the object of the rectangle class. In real-world objects share two characteristics: They have all state and behavior. For example, The squares have state such as : sides and behaviors such as its areas and perimeters. Rectangles have state such as: length, breadth and behavior such as its areas and perimeters. A object implements its behavior with methods of it's classes. A method is a function (subroutine) associated with an object.
Syntax for the Object :
class_name object_name = new class_name();