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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:00, keasiabradley
Search the web for two examples of digital art that you like. the examples must be from different mediums (example: one digital photo and one computer animation not two computer animations). compose an essay for each example you choose about why the piece appeals to you, and identify the medium used.
Answers: 1
image
Computers and Technology, 22.06.2019 09:50, laurentsofia09
Assume that you have an sorted array of records. assume that the length of the array (n) is known. give two different methods to search for a specific value in this array. you can use english or pseudo-code for your algorithm. what is the time complexity for each algorithm and why?
Answers: 1
image
Computers and Technology, 24.06.2019 07:00, AnaiyaKirksey8
You are most likely to automatically encode information about
Answers: 1
image
Computers and Technology, 24.06.2019 07:40, daebreonnakelly
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
Answers: 2
You know the right answer?
1.consider the following code snippet:
int numaxles = 4;
string s = "number of axles i...

Questions in other subjects:

Konu
Biology, 30.01.2020 10:57
Konu
Computers and Technology, 30.01.2020 10:57