- 4

Guess the output of the code ?

class Test{ public void method(int x){ System.out.println("From Test : "+x); } } class Result extends Test{ void method(int x){ System.out.println("From Result : "+x); } public static void main(String s[]){ Test test = new Result(); test.method(10); } }

20th Nov 2020, 6:27 AM
Deepak Soni
Deepak Soni - avatar
5 Answers
+ 3
đŸ€”đŸ€”
20th Nov 2020, 6:42 AM
Matias
Matias - avatar
+ 2
I think from result: 10
20th Nov 2020, 6:39 AM
Matias
Matias - avatar
+ 2
Try on Code playground Then if you have any doubt ask here.
20th Nov 2020, 6:52 AM
Vadivelan
0
Vadivelan thanks for your suggestion. I care your greatest suggestion.
20th Nov 2020, 7:00 AM
Deepak Soni
Deepak Soni - avatar
- 2
Nooopp
20th Nov 2020, 6:40 AM
Deepak Soni
Deepak Soni - avatar