Lecture 3 Flashcards
1
Q
Void Method
A
Void methods do not return anything. Although, the return statement can be used in such a method to branch out of a control flow.
2
Q
Method Overloading
A
Name of a method can be used more than once if the number of parameters of the methods are different or the number of parameters is the same but the types are different (or have a different order).
3
Q
Actual and Formal Parameters
A
Example: public static int add(int x, int y) { return x+y; } public static void main (String[] args) { int a = 4; int b = 7; int result = add(a,b); System.out.println(result); } a and b are the actual parameters. x and y are the formal parameters.