Lecture 3 Flashcards

1
Q

What does a return statement in a void method do?

A

It stops the method (can be used to branch out of a certain control flow).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

For how long are variables accessible?

A

They are accessible until control leaves the block in which they have been declared.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does “pass by value” mean?

A

It means that if DIRECT values are passed to a method, the changes that this method makes to these values are not saved when control leaves the method. If the values that were passed used by the caller method, they will be the exact same as before the call was made.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly