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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly