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

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 2

Question ID: UK8297257
Given code of Test.java file:

package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        int x = 2;
        switch (x) {
            default:
                System.out.println("Still no idea what x is");
            case 1:
                System.out.println("x is equal to 1");
                break;
            case 2:
                System.out.println("x is equal to 2");
                break;
            case 3: 
                System.out.println("x is equal to 3");
                break;
        }
    }
}
What is the result?


Answer: A
Question 3

Question ID: UK8295941
Given code of TestStudent.java file:
package com.examtest.ocp;
 
class Student {
    String name;
    int age;
    boolean result;
    double height;
}
 
public class TestStudent {
    public static void main(String[] args) {
        var stud = new Student(); //Line n1
        System.out.println(stud.name + stud.height + stud.result + stud.age); //Line n2
    }
}
What is the result?


Answer: A
Question 4

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 5

Given code of Test.java file:
package com.examtest.ocp;

public class Test {
    private static String print(String... args) {
        return String.join("-", args); //Line n1
    }
    
    private static Object print(Object... args) {
        String str = "";
        for(Object obj : args) {
            if(obj instanceof String) { //Line n2
                str += (String) obj; //Line n3
            }
        }
        return str; //Line n4
    }
    
    public static void main(String... args) {
        Object obj1 = new String("SPORT"); //Line n5
        Object obj2 = new String("MAD"); //Line n6
        System.out.println(print(obj1, obj2)); //Line n7
    }
}
What is the result?


Answer: A
Page:    1 / 132      
Total 660 Questions | Updated On: Nov 24, 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.