1 B. What type of method does NOT operate on an object? Select one: a. private b
ID: 3693815 • Letter: 1
Question
1B.
What type of method does NOT operate on an object? Select one:
a. private
b. static
c. final
d. instance
2B.
nsert the missing code in the following code fragment. This fragment is intended to implement a method to get the value stored in an instance variable.
Select one:
a. public void setModel(String modelName)
b. public void getModel()
c. public String getModel()
d. public String setModel(String modelName)
3B.
Insert the missing code in the following code fragment. This fragment is intended to implement a method to assign a value to an instance variable.
Select one:
a. public void setModel(String modelName)
b. public void getModel()
c. public String getModel()
d. public String setModel(String modelName)
4B.
Consider the following code snippet:
Which statement reflects the action performed when the constructor to Coin is called?
Select one:
a. The variable coinName will be initialized to "" and the variable coinValue will be initialized to 0.
b. The variable coinName will be initialized to "null" and the variable coinValue will be initialized to 0.
c. The variable coinName will not be initialized but the variable coinValue will be initialized to 0.
d. The variable coinName will be initialized to null and the variable coinValue will be initialized to 0.
5B.
Given the following class definition, which of the following are considered part of the class’s public interface?
Select one:
a. rpmRating and designCode
b. WHEEL_COUNT and designCode
c. WHEEL_COUNT and updatePrice
d. updatePrice and designCode
6B.
Consider the following code snippet:
What is wrong with this code?
Select one:
a. The class instance variable type must be initialized when it is declared.
b. The constructor must not have any arguments.
c. The constructor must not have a return type declared.
d. The constructor's return type must be void.
7B.
Which of the following statements using data values in a class is NOT correct?
Select one:
a. You can use an instance variable's data value in an instance method.
b. You can use the argument of an instance method in that method.
c. You can use a global constant's value in an instance method.
d. You can use the argument of any instance method in any other method.
8B.
hich of the following is NOT part of the declaration of an instance variable?
Select one:
a. the return type
b. a modifier specifying the level of access
c. the data type
d. the name
9B.
Which operator should you use to test whether an object reference is null?
Select one:
a. ==
b. >=
c. <=
d. =
10B.
The utility that formats program comments into a set of documents that you can view in a Web browser is called ____.
Select one:
a. javadoc
b. javac
c. javad
d. java
Explanation / Answer
1B) b static
2B) a public void setModel(String modelName)
3B) a public void setModel(String modelName)
4B) b and d both are same
5B) c WHEEL_COUNT and designCode
6B) a the class instance variable type must be initialized when it is declared
7B) d you can use the argument of an instance method in any other method
8B) a return type
9B) a ==
10B) a javadoc
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.