Why line no 16 in the below code is showing compilationerror? Explain and write how to correct compilation error.[0.5]
1 publicclass X
2 {
3 privateint num=5;
4 }
5 public class Yextends X
6 {
7 publicvoid show()
8 {
9 System.out.println(num);
10 }
11 }
12 public class Test {
13 public staticvoid main(String[] args)
14 {
15 Yob=new Y();
16 ob.show();
17 }
18 }
Expert Answer
An answer will be send to you shortly. . . . .