Different Types of Methods
Topics
Advertisements
- Member Methods
- Constructors
- Nested Member Methods
CISCE: Class 10
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.
CISCE: Class 10
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.
CISCE: Class 10
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.
