METHODS
In Java a method is a block of code that perform a specific task. It helps in code reusability, readability, and modular programming.
A method is a group of statements that are executed when the method is called.
TYPES OF METHODS
- Predefined Methods (from libraries)
- User-defined Methods (written by programmers)
- Based on return type (void, return value)
- Based on parameters (with/without)
- Static / Non-static
- Constructors & main() as special methods
Top comments (0)