The most important thing to understand about a class is that it defines a
new data type. Once defined, this new type can be used to create objects of that type.
Thus, a class is a template for an object, and an object is an instance of a class.A class is declared by use of the class keyword.


SYNTAX:

class classname {

type instance-variable1;
type instance-variable2;
// ...
type instance-variableN;
type methodname1(parameter-list) {
// body of method
}
type methodname2(parameter-list) {
// body of method
}
}




0 comments to "INTRODUCTION TO CLASSES"

Post a Comment

Powered by Blogger.