5. Given the definitions of class x (Figure 3) and class Y (Figure 4) below, class private int d: 4 public x(int c) { c: 7 public int f() { 10 int a = d 1; 11 return a; 12 Figure 3 2 class Y extends x...


5. Given the definitions of class x (Figure 3) and class Y (Figure 4) below,<br>class<br>private<br>int<br>d:<br>4<br>public x(int c) {<br>c:<br>7<br>public<br>int f() {<br>10<br>int<br>a = d<br>1;<br>11<br>return<br>a;<br>12<br>Figure 3<br>2<br>class<br>Y<br>extends x {<br>3<br>private<br>int<br>4<br>public Y(int 5,<br>int t) {<br>super (s);<br>7<br>10 O<br>public int<br>h()<br>11<br>int<br>a;<br>12<br>a = g-l;<br>13<br>return<br>a:<br>14<br>15<br>Figure 4<br>what does the following program display (Figure 5)?<br>class Question5 {<br>public static void main (String [] a) {<br>x e = new x(3):<br>Yn -<br>new Y(2,7):<br>System.out.printin (e.f()):<br>10<br>System.out.printin (n.f()) :<br>11<br>System.out.printin (n.h ()):<br>12<br>13<br>14<br>15<br>Figure 5<br>

Extracted text: 5. Given the definitions of class x (Figure 3) and class Y (Figure 4) below, class private int d: 4 public x(int c) { c: 7 public int f() { 10 int a = d 1; 11 return a; 12 Figure 3 2 class Y extends x { 3 private int 4 public Y(int 5, int t) { super (s); 7 10 O public int h() 11 int a; 12 a = g-l; 13 return a: 14 15 Figure 4 what does the following program display (Figure 5)? class Question5 { public static void main (String [] a) { x e = new x(3): Yn - new Y(2,7): System.out.printin (e.f()): 10 System.out.printin (n.f()) : 11 System.out.printin (n.h ()): 12 13 14 15 Figure 5

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here