5. Explore the following illustration and answer the questions: package pl; public class C1 { public int x; /* (1) Why there is no need to import C1? */ int y; public class C2 { public int testMethod2...


5. Explore the following illustration and answer the questions:<br>package pl;<br>public class C1 {<br>public int x;<br>/* (1) Why there is no need to import C1? */<br>int y;<br>public class C2 {<br>public int testMethod2 () {<br>C1 object = new C1 ():<br>private int z;<br>public int m1 () {<br>/* (2) For each of the following statements,<br>which statement is correct? */<br>int m2 () {<br>object.x;<br>or<br>object.y;<br>// v<br>or<br>object.z;<br>or<br>private int m3 () {<br>object.m1 ();<br>// v or<br>object.m2 () ;<br>or<br>// v or<br>package p2;<br>/* (3) Why there is a need to import C1? */<br>import p1.C1;<br>public class C3 {<br>public int testMethod3 () {<br>C1 object = new C1 () ;<br>/* (4) For each of the following statements,<br>which statement is correct? */<br>object.x;<br>or<br>object.y;<br>// v or<br>object.z;<br>object.ml ():<br>object.m2 ();<br>object.m3 ();<br>or<br>or<br>or<br>or<br>

Extracted text: 5. Explore the following illustration and answer the questions: package pl; public class C1 { public int x; /* (1) Why there is no need to import C1? */ int y; public class C2 { public int testMethod2 () { C1 object = new C1 (): private int z; public int m1 () { /* (2) For each of the following statements, which statement is correct? */ int m2 () { object.x; or object.y; // v or object.z; or private int m3 () { object.m1 (); // v or object.m2 () ; or // v or package p2; /* (3) Why there is a need to import C1? */ import p1.C1; public class C3 { public int testMethod3 () { C1 object = new C1 () ; /* (4) For each of the following statements, which statement is correct? */ object.x; or object.y; // v or object.z; object.ml (): object.m2 (); object.m3 (); or or or or
7. How you can make a class an immutable class?<br>

Extracted text: 7. How you can make a class an immutable class?

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here