subject
Computers and Technology, 22.04.2021 17:30 1162

Consider the following partial class definitions: 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;
...
}
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.
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) 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.

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.
5) The instruction super( ); does which of the following?
A) calls the method super as defined in the current class.
B) calls the method super as defined in the current class'parent class.
C) calls the method super as defined in java. lang.
D) calls the constructor as defined in the current class.
E) calls the constructor as defined in the current class'parent class.
6) Aside from permitting inheritance, the visibility modifier protected is also used to:.
a) permit access to the protected item by any class defined in the same package.
b) permit access to the protected item by any static class.
c) permit access to the protected item by any parent class.
d) ensure that the class can not throw a NullPointerException.
e) define abstract elements of an interface.
7) Which of the following is an example of multiple inheritance?
A) A computer can be a mainframe or a PC.
B) A PC can be a desktop or a laptop.
C) A laptop is both a PC and a portable device.
D) A portable device is a lightweight device.
E) Macintosh and IBM PC are both types of PCs.
8) Java does not support multiple inheritance, but some of the abilities of multiple inheritance are available by:.
a) importing classes.
b) implementing interfaces.
c) overriding parent class methods.
d) creating aliases.
e) using public rather than protected or private modifier.
9) Abstract methods are used when defining:.
a) interface classes.
b) derived classes.
c) classes that have no constructor.
d) arrays.
e) classes that have no methods.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
This isn’t really school related, but like where the heck can you find manga, to read to where you don’t have to pay money, for points? my friend wants me to read bj alex, and i can’t find it anywhere for free.
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
What side length would you specify if you were required to create a regular hexagonal plate that was composed of 33 cm(squared) of sheet metal? dimension the side length to 0.1 cm
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
What type of slide show is a dynamic and eye-catching way to familiarize potential customers with what your company has to offer? a. ole b. photo album c. brochure d. office clipboard
Answers: 2
question
Computers and Technology, 23.06.2019 12:20
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
You know the right answer?
Consider the following partial class definitions: public class A1 {
public int x;
pr...
Questions
question
Mathematics, 02.10.2019 19:00