Question: package p1; class Test8{ package p2; import p1.Test8; int i; Take a look at the class declaration below: package p3; import p1.Test8; import p2.Test9;
package p1; class Test8{ package p2; import p1.Test8; int i; Take a look at the class declaration below: package p3; import p1.Test8; import p2.Test9; private int j; class Test9 extends Test8 { protected int k; class TestDemo3{ public int l; } public static void main(String args[]){ Test8 t8 new Test8(); } Test9 19 = new Test9(); } Out of these 4 variables declared in Test8, which are accessible in Test9 directly and by creating Test8 reference? In TestDemo3 main function, which variables can be used by each of the references t8 and 19?
Step by Step Solution
3.44 Rating (147 Votes )
There are 3 Steps involved in it
Step 1 Only variable l is accessible in Test9 directly by creating a reference of Test8 Reasonvariab... View full answer
Get step-by-step solutions from verified subject matter experts
