Ads Sponsored By Google :)

Saturday, 12 January 2013

what is definition of class|member methods and non member methods in java with example

what is class in java class in java definition of class in java with example class in java with example member methods and non member methods of class in java


                       It is one of the distinct principle in Object Oriented Programming language Or OOP's 
               principles.By using  class concept is always used for developing user / programmer /               
              custom defined data types.
  Each and every java program must start with concept of class.

                   The process of binding data members and associated methods as single unit is 
          known as Class.
         The collection of data members and methods is known as Class.

           Class  <classname>
            Variable declaration;
            Method definition;

        Class demo1
        int x,y; // data members or class variables
        float a,b;// data members or class variables
        int m1()// data methods
       float m2()// data methods
   }; //End of Class

   End of the class by using ; or semicolon  is optionally.

 Note :  When we define class ,there is no memory space is created for data members and associated   methods.

Creation of memory for data members in class when object is created.
We discuss it in briefly in Object

Member methods /non member methods Of class in java

  In Object oriented programming language we have two types of methods they are
 a)      Member Methods
 b)      Non-Menmber methods
       a)      Member Methods:
    The member methods is one which are available with in the scope of class and they can access data members of class.

       b)     Non-Member Methods:

    The Non-Member methods is one which is not available with in the scope of the class and they cannot access data members of class.
Hence java programming concept supports only the concept of member method but the concept of non-member methods.

Object Oriented Programming Principles Are :

No comments:

Post a Comment