Professional Documents
Culture Documents
Methods
MIT 11053, Fundamentals of Programming
By: S. Sabraz Nawaz
Senior Lecturer in MIT
Department of MIT
FMC, SEUSL
Why Write Methods?
System.out.println("Hi!");
A value-returning method not only performs a task, but also sends a value back to the code that
called it.
Body
MIT 11053, By S. Sabraz Nawaz
Parts of a Method Header
displayValue(5);
The argument 5 is copied into the
parameter variable num.