Computer Science, asked by sam4983, 9 months ago

how can you define a method in java​

Answers

Answered by parth0072
1

Answer:

Hope it helps you !!

Explanation:

A method is a block of code which only runs when it is called.

You can pass data, known as parameters, into a method.

Methods are used to perform certain actions, and they are also known as functions.

Why use methods? To reuse code: define the code once, and use it many tim

Answered by Anonymous
3

Answer:

method in Java is a set of instructions that can be called for execution using the method name. A Java method can take in data or parameters and return a value - both parameters and return values are optional. Methods can be public, private or protected.

Similar questions