Review Questions |
4.8 |
Which one of these is a valid method declaration?
Select the one correct answer.
|
4.9 |
Given the following code, which statements can be placed at the indicated position without causing compilation errors?
public class ThisUsage { int planets; static int suns; public void gaze() { int i; // ... insert statements here ... } } Select the three correct answers.
|
4.10 |
Given the following pairs of method declarations, which statements are true?
void fly(int distance) {} int fly(int time, int speed) { return time*speed; } void fall(int time) {} int fall(int distance) { return distance; } void glide(int time) {} void Glide(int time) {} Select the two correct answers.
|
4.11 |
Given a class named Book, which one of these is a valid constructor declaration for the class?
Select the one correct answer.
|
4.12 |
Which statements are true?
Select the two correct answers.
|
4.13 |
What will be the result of attempting to compile the following program?
public class MyClass { long var; public void MyClass(long param) { var = param; } // (1) public static void main(String[] args) { MyClass a, b; a = new MyClass(); // (2) b = new MyClass(5); // (3) } } Select the one correct answer.
|
18.118.186.202