Defining+Methods
Defining+Methods
De ning Methods
fi
The Syntax
“
public final void printName(String name) throws InterruptedException { }
return a + b;
System.out.println(addNumbers(2, 3));
=> 5
long c = 1L;
// return type must be consistent
long c = 1L;
return c * (a + b);