Member Data and Function

Java Programming languages

Member Data and Function

  • Variables which are declared inside class are called data members
  • Data members can be either private or public
  • Similarly, functions declared inside class is called member function

Data Member

  • Variables are declared in class by using fundamental or derived data types. Thes are data members
  • Fundamental data types are like int, char, float etc whereas derived data type are like class, structure, pointer etc

Member Function

  • Operators and functions that are declared as member of class
  • It’s within the scope of its enclosing class