Tuesday, May 24, 2011

OOPS Concept-Class

Class:
In object-oriented programming, a class is a programming language construct that is used as a blueprint to create objects. This blueprint includes attributes and methods that the created objects all share.
Usually, a class represents a person, place, or thing - it is an abstraction of a concept within a computer program. Fundamentally, it encapsulates the state and behavior of that which it conceptually represents. It encapsulates state through data placeholders called member variables; it encapsulates behavior through reusable code called methods.

More technically, a class is a cohesive package that consists of a particular kind of meta data. It describes the rules by which objects behave; these objects are referred to as instances of that class. A class has both an interface and a structure. The interface describes how the class and its instances can be interacted with via methods, while the structure describes how the data is partitioned into attributes within an instance. A class may also have a representation (meta object) at run time, which provides run time support for manipulating the class-related meta data. In object-oriented design, a class is the most specific type of an object in relation to a specific layer.

Programming languages that support classes all subtly differ in their support for various class-related features. Most support various forms of class inheritance. Many languages also support features providing encapsulation, such as access specifiers.
class Example:
Class java
{
properties(variables);
Actions(methods);
}

No comments: