7.6 |
Which statement is true? Select the one correct answer.
|
7.7 |
Given the declaration interface IntHolder { int getInt(); } which of the following methods are valid? //----(1)---- IntHolder makeIntHolder(int i) { return new IntHolder() { public int getInt() { return i; } }; } //----(2)---- IntHolder makeIntHolder(final int i) { return new IntHolder { public int getInt() { return i; } }; } //----(3)---- IntHolder makeIntHolder(int i) { class MyIH implements IntHolder { public int getInt() { return i; } } return new MyIH(); } //----(4)---- IntHolder makeIntHolder(final int i) { class MyIH implements IntHolder { public int getInt() { return i; } } return new MyIH(); } //----(5)---- IntHolder makeIntHolder(int i) { return new MyIH(i); } static class MyIH implements IntHolder { final int j; MyIH(int i) { j = i; } public int getInt() { return j; } } Select the two correct answers.
|
7.8 |
Which statements are true? Select the two correct answers.
|
7.9 |
Which statement is true? Select the one correct answer.
|