answersLogoWhite

0

A Method in Java is a piece of code that is designed to perform a specific operation. It takes in input arguments processes them and then returns a value.

Ex:

public int sum(int a, int b) {

return a + b;

}

The above method takes two integer arguments and returns the sum of the two numbers passed.

User Avatar

Wiki User

∙ 17y ago
User Avatar

What else can I help you with?