1. package com.udayan.ocp;
2.
3. interface Printer1 {
4. default void print() {
5. System.out.println("Printer1");
6. }
7. }
8.
9. class Printer2 {
10. public void print() {
11. System.out.println("Printer2");
12. }
13. }
14.
15. class Printer extends Printer2 implements Printer1 {
16.
17. }
18.
19. public class Test {
20. public static void main(String[] args) {
21. Printer printer = new Printer();
22. printer.print();
23. }
24. }
What will be the result of compiling and executing Test class?
//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?
© Copyrights Dumpscity 2025. All Rights Reserved
We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the Dumpscity.