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, 21.06.2019 18:30
Ayear in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: the year must be divisible by 4if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year.ex: if the input is 1913, the output is: 1913 is not a leap year.
Answers: 2
question
Computers and Technology, 22.06.2019 02:00
Alocal reaction will occur at the site of the exposure such as irritation or damage to the skin eye or local reaction will occur at the site of the exposure such as irritation or damage to the skin ireland lounges
Answers: 3
question
Computers and Technology, 22.06.2019 06:40
Match the personality traits with their description
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
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, 29.01.2020 06:47
question
French, 29.01.2020 06:47