Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public class A1 { public int x; private int y; protected int z; ... } public class A2 extends A1 { protected int a; private

public class A1 {

public int x;

private int y;

protected int z;

... }

public class A2 extends A1

{

protected int a;

private int b; ...

}

public class A3 extends A2 {

private int q; ...

}

3-1) Which of the following is true with respect to A1, A2 and A3? _____ A) A1 is a subclass of A2 and A2 is a subclass of A3 B) A3 is a subclass of A2 and A2 is a subclass of A1 C) A1 and A2 are both subclasses of A3

D) A2 and A3 are both subclasses of A1 E) A1, A2 and A3 are all subclasses of the class A

3-2) Which of the following lists of instance data are accessible in class A2? ______________

A) x, y, z, a, b

B) x, y, z, a

C) x, z, a, b

D) z, a, b

E) a, b

3-3) Which of the following lists of instance data are accessible in A3?

A) x, y, z, a, b, q

B) a, b, q

C) a, q D) x, z, a, q

E) x, a, q

3-4) Which of the following is true regarding the use of instance data y of class A1?

A) It is accessible in A1, A2 and A3 B) It is accessible in A1 and A2 C) It is accessible only in A1

D) It is accessible only in A3 E) It is not accessible to any of the three classes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions