1.
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?
2.
Why should package names in Java be unique?
3.
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?
4.
Given: 3. int calc() { 4. long x = 40L; 5. int i = 30; 6. i = x; 7. System.out.println("result is: " + i); 8. } What is the result of calling calc()?
5.
Which is an appropriate description of session beans?
6.
Which is NOT associated with the web tier in a J2EE web-based application?
7.
Which option will correctly initialize the property com.example.property to someValue when invoking java?
8.
Which is an advantage of applets over HTML/JavaScript clients?
9.
Why should package names in Java be unique?
10.
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?