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 21:00
Which function key is used to enable the spelling & grammar function in a word processing program such as microsoft word?
Answers: 3
question
Computers and Technology, 22.06.2019 08:00
Someone with this coz i don’t really know what i can choose, just pick whatever u want. homework - you need to choose a website that you like or use frequently. you must visit the website and discuss 6 different features/parts/aspects of the website that you think makes it good. (100 words)
Answers: 2
question
Computers and Technology, 22.06.2019 11:30
One subtask in the game is to roll the dice. explain why is roll the dice an abstraction.
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
You know the right answer?
Consider the following partial class definitions: public class A1 {
public int x;
pr...
Questions
question
Mathematics, 09.12.2020 07:50
question
Chemistry, 09.12.2020 07:50
question
Mathematics, 09.12.2020 07:50
question
Mathematics, 09.12.2020 07:50
question
Mathematics, 09.12.2020 07:50
question
Mathematics, 09.12.2020 07:50
Questions on the website: 13722362