Predict the output of the following code: public class MyClass extends Test { public static void main(String[] args) { MyClass x = new MyClass(); Test y = new MyClass(); System.out.println(x.num() + "...


Predict the output of the following code:
public class MyClass extends Test
{
public static void main(String[] args) {
MyClass x = new MyClass();
Test y = new MyClass();
System.out.println(x.num() + " " + y.num());
}
public static int num() {
return 2;
}
}
class Test
{
public static int num() {
return 5;
}
}



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here