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, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Cloud computing service providers manage different computing resources based on the services they offer. which resources do iaas and paas providers not manage? iaas providers do not manage the for the client, whereas paas providers usually do not manage the for their clients. iaas- storage server operating system network paas- applications interafce storage vertualiation
Answers: 2
question
Computers and Technology, 23.06.2019 09:10
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
Which of these is an example of an integrated presentation? a. a table created in powerpoint b. an image pasted into powerpoint c. a caption created in powerpoint d. an excel chart pasted into powerpoint
Answers: 1
You know the right answer?
1.consider the following code snippet:
int numaxles = 4;
string s = "number of axles i...
Questions
question
Social Studies, 07.05.2021 21:10
question
Mathematics, 07.05.2021 21:10
question
Mathematics, 07.05.2021 21:10
Questions on the website: 13722359