Wednesday, February 6, 2013

What is Class ?



CLASS:

A class is a blue print from which individual objects are created

SYNTAX:

     class classname
    {
        Member variables; //as many as you want
        Methods;//as many as you want
     };
      
EXAMPLE:

class Student
{
          int sNo;
         String studName;
  
          void getStudent() //METHOD
          {
           sNo=1;
           sName="Java";
           }

          void getStudent() //METHOD
          {
           sNo=1;
           sName="Java";
           }

}

A class can have any number of methods to access the value of various kind of methods.


0 comments:

Post a Comment