Sun Certified Java Developer Question:
Download Questions PDF

Suppose A team of programmers is reviewing a proposed API for a new utility class. After some discussion, they realize
that they can reduce the number of methods in the API without losing any functionality. If they implement the
new design, which two OO principles will they be promoting?
A. Looser coupling
B. Tighter coupling
C. Lower cohesion
D. Higher cohesion
E. Weaker encapsulation
F. Stronger encapsulation

Answer:

A:Looser coupling

Download Sun Certification Interview Questions And Answers PDF

Previous QuestionNext Question
Explain Given: 1. public class Threads2 implements Runnable { 2. 3. public void run() { 4. System.out.println("run."); 5. throw new RuntimeException("Problem"); 6. } 7. public static void main(String[] args) { 8. Thread t = new Thread(new Threads2()); 9. t.start(); 10. System.out.println("End of method."); 11. } 12. } Which two can be results? (Choose two.) A. java.lang.RuntimeException: Problem B. run. java.lang.RuntimeException: Problem C. End of method. java.lang.RuntimeException: Problem D. End of method. run. java.lang.RuntimeException: Problem E. run. java.lang.RuntimeException: Problem End of method.Explain Given: 11. public static void parse(String str) { 12. try { 13. float f = Float.parseFloat(str); 14. } catch (NumberFormatException nfe) { 15. f = 0; 16. } finally { 17. System.out.println(f); 18. } 19. } 20. public static void main(String[] args) { 21. parse("invalid"); 22. } What is the result? A. 0.0 B. Compilation fails. C. A ParseException is thrown by the parse method at runtime. D. A NumberFormatException is thrown by the parse method at runtime.