Advantages of Methods

syntax:

image.png

Classification of Methods

  1. Based on there Creation

    image.png

    1. Predefine Method: A methods which is known by the java is known as predefine/use define method
    2. User Define Method: A methods which is defined by user is known as predefine/use define method
  2. Based on Format Arguments

    image.png

    1. No-Argument Methods: Methods that do not accept any parameters (e.g., void sayHello()).
    2. Parameterized Methods: Methods that accept one or more parameters (formal arguments, e.g., void add(int a, int b)).
  3. Based on there Modifier

    image.png

    1. Static Methods: Declared with the static keyword; belong to the class, not instances (e.g., static void main()).
    2. Non static Method: Not declared with static; belong to instances of the class. These are further classified into:
      1. Concrete Method: The method which are non-static and have method body(implementation).
      2. Abstract Method: The non static Method which does not have method body (implementation).

    Terminologies:

    image.png

https://excalidraw.com/#json=eHRhwp44ffk722I1llSsd,p6jKYAAX1c_Ib2pQlgFJrw

Modifier: