Question ID: UK8291153Given code of Test.java file:package com.examtest.ocp; import java.util.ArrayList;import java.util.List; class Person { private String name; private int age; Person(String name, int age) { this.name = name; this.age = age; } public String toString() { return "Person[" + name + ", " + age + "]"; } public boolean equals(Person obj) { if(obj instanceof Person) { Person person = (Person)obj; if(this.name.equals(person.name) && this.age == person.age) { return true; } } return false; }} public class Test { public static void main(String[] args) { List
Question ID: UK8297257Given 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?
Question ID: UK8291924Given 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?
Question ID: UK8297789Given 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
Given the directory structure:
Given the definition of the Doc class:
Which two are valid definition of the wordDoc class?
© Copyrights FreePDFQuestions 2026. All Rights Reserved
We use cookies to ensure that we give you the best experience on our website (FreePDFQuestions). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the FreePDFQuestions.