DEV Community

Cover image for METHODS IN JAVA
Vinoth Kumar
Vinoth Kumar

Posted on

METHODS IN JAVA

METHODS :

Methods are blocks of code that perform a specific task. A method allows us to reuse code, improving both efficiency and organization. All methods in Java must belong to a class. Methods are similar to functions and expose the behavior of objects.

TYPES OF METHODS IN JAVA:

  1. Predefined Method.
  2. User-defined Method

1) PRE-DEFINED METHODS :

The method that is already defined in the Java class libraries. It is also known as the standard library method or built-in method.

2)** USER-DEFINED METHODS :**

Method written by the user or programmer is known as a user-defined method. These methods are modified according to the requirement.

Top comments (0)