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 14, 2024
Add To Cart
Question 1

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
Question 2

Question ID: UK8291985
Consider below code of Test.java file:
package com.examtest.ocp;
 
import java.time.LocalDate;
 
public class Test {
    public static void main(String [] args) {
        LocalDate date = LocalDate.parse("1980-03-16");
        System.out.println(date.minusYears(-5));
    }
}
What is the result?


Answer: B
Question 3

Question ID: UK8297279
Consider below code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String [] args) {
        boolean flag1 = true;
        boolean flag2 = false;
        boolean flag3 = true;
        boolean flag4 = false;
        
        System.out.println(!flag1 == flag2 != flag3 == !flag4); //Line n1
        System.out.println(flag1 = flag2 != flag3 == !flag4); //Line n2
    }
}
What is the result?


Answer: A
Question 4

Question ID: UK8296869
Given code of Test.java file:
package com.examtest.ocp;
 
class Parent {
    int var = 1000; // Line n1
 
    int getVar() {
        return var;
    }
}
 
class Child extends Parent {
    private int var = 2000; // Line n2
 
    int getVar() {
        return super.var; //Line n3
    }
}
 
public class Test {
    public static void main(String[] args) {
        Child obj = new Child(); // Line n4
        System.out.println(obj.var); // Line n5
    }
}
There is a compilation error in the code.
Which three modifications, done independently, print 1000 on to the console?


Answer: A,B,D
Question 5

Question ID: UK8291961
Consider below statements:
1. int x = 5____0;
2. int y = ____50;
3. int z = 50____;
4. float f = 123.76_86f;
5. double d = 1_2_3_4;
How many statements are legal?


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