Class

Class

It is the central point of OOP and that contains data and codes with behavior. In java everything happens within class and it describes a set of objects with common  behavior.

Syntax
class classname
{ Data member
——————-
——————-
——————-
Member function
——————-
——————-
——————-
}

 

Data members

They indicate information about an object current state of the object.

Syntax
[access specifier] datatype membername;

 

Member function

They indicates the operation which we can perform on the object.

Syntax
[access specifier] datatype function name;
{
statement;
——————–
——————–
——————–
return value;
}

Leave a Reply

Your email address will not be published. Required fields are marked *