Oracle 1Z0-829 Exam Real Questions

Prepare and pass your Java SE 17 Developer with free 1Z0-829 exam questions.

Page:    1 / 132      
Total 660 Questions | Updated On: Oct 10, 2024
Add To Cart
Question 1

Question ID: UK8291549
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    private static void m(int i) {
        System.out.print(1);
    }
    
    private static void m(int i1, int i2) {
        System.out.print(2);
    }
    
    private static void m(char... args) {
        System.out.print(3);
    }
   
    public static void main(String... args) {
        m('A');
        m('A', 'B');
        m('A', 'B', 'C');
        m('A', 'B', 'C', 'D');
    }
}
What is the result?


Answer: C
Question 2

Skipped
Question ID: UK8295920
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        int x = 4;
        switch (x) {
            default -> System.out.println("Unknown");
            case 1 -> System.out.println("x is equal to 1");
            case 2 -> System.out.println("x is equal to 2");
            case 3 -> System.out.println("x is equal to 3");
        }
    }
}
What is the result?


Answer: B
Question 3

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 4

Question ID: UK8297291
Consider below code snippet:
var x = Double.valueOf(Math.random() * 10).intValue();
System.out.println(x);
Which of the following statements is correct?


Answer: D
Question 5

Question ID: UK8291180
Given code of Test.java file:
package com.examtest.ocp;
 
sealed abstract class Animal permits Cat, Dog { } //Line n1
 
non-sealed class Cat extends Animal { } //Line n2
 
final class Dog extends Animal { } //Line n3
 
final class Tiger extends Animal { } //Line n4
 
public class Test {
    public static void main(String [] args) {
        System.out.println("PERMITS CLAUSE");
    }
}
What is the result?


Answer: A
Page:    1 / 132      
Total 660 Questions | Updated On: Oct 10, 2024
Add To Cart

© Copyrights DumpsCertify 2024. All Rights Reserved

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