Free Oracle 1Z0-829 Exam Questions

Become Oracle Certified with updated 1Z0-829 exam questions and correct answers

Page:    1 / 132      
Total 660 Questions | Updated On: Jun 05, 2022
Add To Cart
Question 1

Question ID: UK8291167
Given code:
package com.examtest.ocp;
 
interface Message {
    String msg = "CONSISTENCY";
    public default void quoteOfTheDay() {
        record Quote(){ //Line n1
            String combine(String str) {
                return msg + "=" + str; //Line n2
            }
        }
        System.out.println(new Quote().combine("SUCCESS")); //Line n3
    }
}
 
public class Test {
    public static void main(String[] args) {
        new Message(){}.quoteOfTheDay(); //Line n4
    }
}
What is the result?


Answer: A
Question 2

Question ID: UK8298152
Consider below code:
package com.examtest.ocp;
 
import java.time.LocalDate;
 
public class Test {
    public static void main(String [] args) {
        LocalDate d1 = LocalDate.parse("1999-09-09");
        LocalDate d2 = LocalDate.parse("1999-09-09");
        LocalDate d3 = LocalDate.of(1999, 9, 9);
        LocalDate d4 = LocalDate.of(1999, 9, 9);
        System.out.println((d1 == d2) + ":" + (d2 == d3) + ":" + (d3 == d4));
    }
}
What is the result?


Answer: D
Question 3

Question ID: UK8294624
Given code:
package com.examtest.ocp;
 
class Outer {
    private String msg = "A";
    public void print() {
        final String msg = "B";
        class Inner {
            public void print() {
                System.out.println(this.msg);
            }
        }
        Inner obj = new Inner();
        obj.print();
    }
}
 
public class Test {
    public static void main(String[] args) {
        new Outer().print(); 
    }
}
What is the result?


Answer: A
Question 4

Question ID: UK8291924
Given code of Test.java file:
package com.examtest.ocp;
 
import java.time.*;
 
public class Test {
    public static void main(String [] args) {
        Period period = Period.ofWeeks(100);
        System.out.println(period);
    }
}
What is the result?


Answer: C
Question 5

Question ID: UK8298581
Given the code fragment:
String txt = "an";
System.out.println(txt.split("an").length);
What is the result?


Answer: A
Page:    1 / 132      
Total 660 Questions | Updated On: Jun 05, 2022
Add To Cart

© Copyrights DumpsCertify 2025. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the DumpsCertify.