Q13: In the following code, the classes A and B are in different packages. If the question marks in (a) are replaced by blanks, can class B be compiled? If the question marks are replaced by...


Q13: In the following code, the classes A and B are in different packages.<br>If the question marks in (a) are replaced by blanks, can class B be compiled?<br>If the question marks are replaced by protected, can class B be compiled?<br>package p1;<br>package p2;<br>public class A {<br>int i;<br>public class B extends A {<br>public void m1(String[] args) {<br>System.out.println(i);<br>m();<br>}<br>}<br>?<br>?<br>void m() {<br>...<br>}<br>}<br>(b)<br>a. NO to both<br>b. Yes / No<br>c. No / Yes<br>d. Yes to both<br>

Extracted text: Q13: In the following code, the classes A and B are in different packages. If the question marks in (a) are replaced by blanks, can class B be compiled? If the question marks are replaced by protected, can class B be compiled? package p1; package p2; public class A { int i; public class B extends A { public void m1(String[] args) { System.out.println(i); m(); } } ? ? void m() { ... } } (b) a. NO to both b. Yes / No c. No / Yes d. Yes to both

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here