Given:
1. abstract class A {}
2. class B {}
3. interface C {}
4. interface D {}
5. // insert code here
Which, inserted at line 5, results in a compilation failure?
Given:
18. String s = " abcdcba ";
19. int x = 2;
20. s = s.trim();
21. if (s.length() < 8) {
22. x = s.indexOf('c', 3);
23. }
24. System.out.println("x = " + x);
What is the result?
Given:
1. public class Boat{
2. // insert code here
3. public void setGas(int v){
4. gas = v;
5. }
6. }
Which, inserted at line 2, is valid and demonstrates encapsulation?