Given this code for a Planet object:

Given code of Test.java file:
1. package com.sampleproject.oca;
2.
3. public class Test {
4. public static void main(String[] args) {
5. try { //outer
6. try { //inner
7. System.out.println(1/0);
8. } catch(ArithmeticException e) {
9. System.out.println("INNER");
10. } finally {
11. System.out.println("FINALLY 1");
12. }
13. } catch(ArithmeticException e) {
14. System.out.println("OUTER");
15. } finally {
16. System.out.println("FINALLY 2");
17. }
18. }
19. }
What will be the result of compiling and executing Test class?
Consider below code:
1. //Test.java
2. package com.udayan.oca;
3.
4. import java.time.LocalDate;
5.
6. public class Test {
7. public static void main(String [] args) {
8. LocalDate joiningDate = LocalDate.parse("2006-03-16");
9. System.out.println(joiningDate.withDayOfYear(29));
10. }
11. }
What will be the result of compiling and executing Test class?
Consider below codes of 3 java files:
1. //Super.java
2. package com.sampleproject.oca;
3.
4. public interface Super {
5. String name = "SUPER"; //Line n1
6. }
1. //Sub.java
2. package com.sampleproject.oca;
3.
4. public interface Sub extends Super { //Line n2
5.
6. }
1. //Test.java
2. package com.sampleproject.oca;
3.
4. public class Test {
5. public static void main(String[] args) {
6. Sub sub = null;
7. System.out.println(sub.name); //Line n3
8. }
9.
Which of the following statements is correct?
Which two statements are true? (Choose two.)
© Copyrights Oracledumps 2025. All Rights Reserved
We use cookies to ensure that we give you the best experience on our website (Oracledumps). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the Oracledumps.