Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use the following partial classes for the next seven questions. The four classes

ID: 3752808 • Letter: U

Question

Use the following partial classes for the next seven questions. The four classes below are in the same package (and directory) In these questions, direct access means that you can access the variable without a public getter. That might be directly such as "System.out.println(variable)" or it might be through an object of the class such as otherClassObject.variable. Either of these would be considered direct access. public class Classi f public String a; private String b; protected String c; public class Class2 extends Class1 protected String x; private String y; public String z; public class Class3 extends Class2 private String q; protected String r; public String s; public class Class4 f

Explanation / Answer

Which variables can be accessed from within Class1

Ans)a,b,c

____________

Which variables can be accessed from within Class2

Ans)a,c,x,y,z

____________

Which variables can be accessed from within Class3

Ans)a,c,x,z,q,r,s

____________

Which variables can be accessed from within Class4

Ans)a,c,x,z,r,s

____________

Which of the following is true about Class4?

Ans) It has no parent class

____________

Which variables can be accessed from within Class5

Ans)a,z,s

____________

Which variables can be accessed from within Class6

Ans)a,z,s

____________Thank You