Explain methods in java | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Explain methods in java

java

21st Aug 2018, 4:49 AM
Randy Ranji
3 Respostas
21st Aug 2018, 5:02 AM
Hatsy Rei
Hatsy Rei - avatar
+ 1
methods in Java are like functions in other languages like C++. they take parameters (or arguments), there is some code or operation on the parameter, and it may or may not return a value. if it returns a value then the code must not be void.
21st Aug 2018, 6:27 AM
H U
H U - avatar
+ 1
A method is a collection of statements that perform some specific task and return result to the caller. A method can perform some specific task without returning anything. Methods allow us toĀ reuseĀ the code without retyping the code. In Java, every method must be part of some class which is different from languages like C, C++ and Python. Methods areĀ time saversĀ and help us toĀ reuseĀ the code without retyping the code.
21st Aug 2018, 11:52 AM
Maninder $ingh
Maninder $ingh - avatar