subject

1.consider the following code snippet:
int numaxles = 4;
string s = "number of axles is " + numaxles;

which of the following statements is correct?
answer

a. the
tostring()
method of the
object
class is being used to set the value of
s
.
b. the
tostring()
method of the
string
class is being used to set the value of
s
.
c. no
tostring()
method is being used to set the value of
s
.
d. this code will not compile.

2.which of the following statements about abstract classes is not true?

a. a class that inherits an abstract method and does not override it must be declared as abstract.
b. a class cannot be declared as abstract if it has no abstract methods.
c. you cannot instantiate an object from an abstract class.
d. you can construct a variable whose type is an abstract class.

3.an identifying value called a/an is assigned by the java runtime to an object when it is created, to allow the java runtime to tell objects apart.
answer

a. object identifier
b. uid
c. object code
d. hash code

4.the dual use of the
super
keyword is analogous to the dual use of the keyword.
answer

a. final
b. instanceof
c. this
d. abstract
5.when designing a hierarchy of classes, features and behaviors that are common to all classes are placed in
answer

a. every class in the hierarchy
b. the superclass
c. a single subclass
d. all subclasses

6.consider the following code snippet:
auto consumerauto = new auto (4, "gasoline");
string s = consumerauto. tostring();

assume that the
auto
class has not implemented its own
tostring()
method. what value will
s
contain when this code is executed?
answer

a. s
will contain the values of the instance variables in
consumerauto
.
b. s
will contain only the name of the
consumerauto
object.
c. s
will contain the name of the
consumerauto
object followed by a hash code.
d. this code will not compile.

7.which of the following is true regarding inheritance?
answer

a. when creating a subclass, all methods of the superclass must be overridden.
b. when creating a subclass, no methods of a superclass can be overridden.
c. a superclass can force a programmer to override a method in any subclass it creates.
d. a superclass cannot force a programmer to override a method in any subclass it creates.

8.
which of the following statements is true regarding the bank account classes presented in the textbook?
answer

a. the
checkingaccount
class uses the same
deposit
method as its superclass.
b. the
checkingaccount
class uses the same
withdraw
method as its superclass..
c. the
checkingaccount
class uses the same
getbalance
method as its superclass..
d. the
checkingaccount
class uses the same
deductfees
method as its superclass..

9.which of the following statements about classes is not true?
answer

a. every class extends the
object
class either directly or indirectly.
b. only classes with an explicit
extends
clause extend the
object
class.
c. the
object
class is the direct or indirect superclass of every class in java.
d. the
object
class is the direct superclass of every class that does not have an explicit
extends
clause.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:40
In the lab, which of the following displayed a list of all installed services and included a description of the service, the current state, and whether the service started automatically or manually? a. the services manager b. the applications summary c. the recommended services d. list the safe services list
Answers: 2
question
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
You know the right answer?
1.consider the following code snippet:
int numaxles = 4;
string s = "number of axles i...
Questions
question
Mathematics, 04.05.2021 03:30
question
Mathematics, 04.05.2021 03:30
question
Mathematics, 04.05.2021 03:30
question
Mathematics, 04.05.2021 03:30
Questions on the website: 13722367