//Test.java
package com.udayan.ocp;
class Player {
String name;
int age;
Player() {
this.name = "Virat";
this.age = 29;
}
public int hashCode() {
return 100;
}
}
public class Test {
public static void main(String[] args) {
System.out.println(new Player());
}
}
Hexadecimal representation of 100 is 64.
Which of the following option is correct?
1. package com.udayan.ocp;
2.
3. import java.util.Arrays;
4. import java.util.List;
5. import java.util.function.Predicate;
6.
7. public class Test {
8. public static void main(String[] args) {
9. List
10. Predicate
11. int ctr = 1;
12. boolean result = num > 0;
13. System.out.print(ctr++ + ".");
14. return result;
15. };
16.
17. list.stream().filter(predicate).findFirst();
18. }
19. }
What will be the result of compiling and executing Test class?

1. package com.udayan.ocp;
2.
3. class M {
4. private int num1 = 100;
5. class N {
6. private int num2 = 200;
7. }
8.
9. public static void main(String[] args) {
10. M outer = new M();
11. M.N inner = outer.new N();
12. System.out.println(outer.num1 + inner.num2);
13. }
14. }
© Copyrights DumpsEngine 2025. All Rights Reserved
We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the DumpsEngine.
