Saturday 26 December 2015

What is class in java

Class



A class is a prototype that defines the variables and the methods common to all objects of a certain kind. 

Member Functions operate upon the member variables of the class. Collection of objects is called class. It is a logical entity.

A class, in the context of Java, are templates that are used to create objects, and to define object data types and methods.


Class declaration

A class is a template for manufacturing objects. You declare a class by specifying the class keyword followed by a non-reserved identifier that names it.


Example:


class identifier
{
   // class body

}


No comments:

Post a Comment