반응형
자격증/OCJP_ExamA2018. 7. 8. 02:03QUESTION 37

QUESTION 37 Given: 01. Float pi = new Float(3.14f); 02. if (pi > 3) { 03. System.out.print("pi is bigger than 3. "); 04. } 05. else { 06. System.out.print("pi is not bigger than 3. "); 07. } 08. finally { 09. System.out.println("Have a nice day."); 10. } What is the result? A. Compilation fails. B. pi is bigger than 3. C. An exception occurs at runtime. D. pi is bigger than 3. Have a nice day. E..

자격증/OCJP_ExamA2018. 7. 8. 01:59QUESTION 36

QUESTION 36 Given: public void method() { A a = new A(); a.method1(); } Which statement is true if a TestException is thrown on line 3 of class B? 1. public class A{ 2. public void method1() { 3. try { 4. B b = new B(); 5. b.method2(); 6. //more code here 7. } catch (TestException te){ 8. throw new RuntimeException(te); 9. } 10. } 11. } 1. public class B{ 2. public void method2() throws TestExce..

반응형
image