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 18:00
Amara created a workbook to track the number of minutes she reads each week. each day, she entered the number of minutes into the workbook. identify the types of data in the workbook using the drop-down menus.
Answers: 3
question
Computers and Technology, 23.06.2019 01:00
Petrică, tânăr licean în clasa a ix-a, a primit în dar de la părinţii săi un cont bancar pentru micile sale cheltuieli curente. el este pasionat de internet banking şi îşi verifică cu grijă toate tranzacţiile efectuate. pentru creşterea securităţii tranzacţiilor online, banca îi furnizează lui petrică un număr pe care el va trebui să îl modifice, obţinând un număr tan – număr de autentificare a tranzacţiei (transaction authentication number). regula de obţinere a numărului tan este următoarea: se formează cel mai mic număr par din toate cifrele numărului furnizat de bancă. cerinţă cunoscând numărul n furnizat de bancă, să se determine numărul tan obţinut de petrică. date de intrare fişierul tan.in conţine pe prima linie numărul natural n cu semnificaţia din enunţ. date de ieşire fişierul de ieşire tan.out va conţine o singură linie pe care va fi scris numărul tan cerut. restricţii • 0 < n < 18*1018 • n are cel puţin o cifră pară • numărul tan obţinut nu poate conţine zerouri nesemnificative
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
You know the right answer?
Consider the following partial class definitions: public class A1 {
public int x;
pr...
Questions
question
Biology, 21.08.2019 04:50
question
English, 21.08.2019 04:50
Questions on the website: 13722367