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: Dec 06, 2025
Add To Cart
Question 1

Question ID: UK8297797
Given code:
package com.examtest.ocp;
 
import java.util.ArrayList;
import java.util.List;
 
public class Test {
    public static void main(String[] args) {
       var list = new ArrayList<String>(); //Line n1
       list.add("A");
       list.add("M");
       var list_of_list = List.of(list); //Line n2
       list_of_list.get(0).set(1, "N"); //Line n3
       list_of_list.get(0).forEach(System.out::print); //Line n4
    }
}
What is the result?


Answer: D
Question 2

Question ID: UK8292478
Given code of Test.java file:
package com.examtest.ocp;
 
import java.util.Arrays;
 
public class Test {
    public static void main(String[] args) {
        int [] array1 = {};
        int [] array2 = {100, 200};
        System.out.print(Arrays.compare(array1, array2));
        System.out.print(Arrays.mismatch(array1, array2));
    }
}
What is the result?


Answer: A
Question 3

Question ID: UK8298194
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        short [] args = new short[]{50, 50};
        args[0] = 5;
        args[1] = 10;
        System.out.println("[" + args[0] + ", " + args[1] + "]");
    }
}
What is the result?


Answer: A
Question 4

Given the content of the in. tart file:

23456789

and the code fragment:




What is the content of the out .txt file? 


Answer: D
Question 5

Question ID: UK8297789
Given code of Test.java file:
package com.examtest.ocp;
 
import java.util.ArrayList;
import java.util.List;
 
public class Test {
    public static void main(String[] args) {
        Boolean [] arr = new Boolean[2];
        List<Boolean> list = new ArrayList<>();
        list.add(arr[0]);
        list.add(arr[1]);
        
        if(list.remove(0)) {
            list.remove(1);
        }
        
        System.out.println(list);
    }
}
What is the result?


Answer: C
Page:    1 / 132      
Total 660 Questions | Updated On: Dec 06, 2025
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.