Methods

Introduction

It is a one of the key element in a Class that is mainly used to work on Attributes/Properties. It is considered as the Behavior of an Object. Method do have different visibility. In this Page, It will be discussed clearly the different types of Methods in OOP in detail.

Types Of Methods

Methods can be classified a two main branches

  • Built In Methods
  • User Defined Methods

Built-In Methods

There are several Built in Method that is part of the Java Programming Language and Other Imported Libraries. In order to user this method, the only thing that we need to have is an Object created from the main class where the methods resides.

User Defined Methods

These are methods created and customized as per the need of our business behavior. The methods act on the Object where the class define the behavior and properties of the Object.

Note :-

  • Both Built in as well as User Defined Methods can be set to return or not return a value.
  • Method do have a visibility or access modifiers

Main Method

This is a Method where the program execution starts.Each A program is made of set of different Class Plus one Main Method. The structure of the main Method as follow

Figure 1. 1 Main Function

Scroll to Top