मराठी

Different Types of Methods

Advertisements

Topics

  • Member Methods
  • Constructors
  • Nested Member Methods 

Member Methods:

The methods defined within a class are known as member methods. The member methods basically deal with the instance variables of the class. Member methods, also called functions, can be public or private, handle instance variables, and may be parameterized with return values. 

Constructors:

This is a special type of member method used to initialize instance variables. The unique thing about a constructor is they possess the same name as the class name. 

Nested Member Methods:

A member method can be used within another method to fulfill some requirements. This is known as nesting of member methods. In this system, a method is invoked under another method. 

If you would like to contribute notes or other learning material, please submit them using the button below.

Related QuestionsVIEW ALL [5]

Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×