Question: Question 9 (0.625 points) In the statement public void moveHorizontal(int distance) void is: Question 9 options: a constant a method a parameter a return type
Question 9 (0.625 points)
In the statement
public void moveHorizontal(int distance)
void is:
Question 9 options:
|
| a constant |
|
| a method |
|
| a parameter |
|
| a return type |
|
| a variable |
Question 10 (0.625 points)
Objects communicate by:
Question 10 options:
|
| calling each others constants |
|
| calling each others classes |
|
| calling each others fields |
|
| calling each others states |
|
| calling each others methods |
Question 11 (0.625 points)
In the statement
moveHorizontal(-20); -20 is:
Question 11 options:
|
| an object |
|
| a parameter |
|
| a variable |
|
| a return value |
|
| a class |
Question 12 (0.625 points)
Consider this code with line numbers at left:
1 public class Product { 2 private int id; 3 4 public Product() { 5 id = 1; 6 } 7 8 public int getId() { 9 return id; 10 } 11 } What is the name of the class shown?
Question 12 options:
|
| public |
|
| getId |
|
| id |
|
| Product |
|
| private |
Question 13 (0.625 points)
If a class is named Automobile, what would be the name of its constructor?
Question 13 options:
|
| getAutomobile |
|
| automobileClass |
|
| myAutomobile |
|
| classAutomobile |
|
| Automobile |
Question 14 (0.625 points)
public void calculate(int x) { } If a value of 50 is passed to the method calculate, 50 is considered to be:
Question 14 options:
|
| a method value |
|
| an actual parameter |
|
| an instance variable |
|
| a formal parameter |
|
| none of the above |
Question 15 (0.625 points)
The insertMoney method from TicketMachine, shown below, is a mutator.
public void insertMoney(int amount) { balance = balance + amount; } Question 15 options:
| True | |
| False |
Question 16 (0.625 points)
Which methods return information about the state of an object?
Question 16 options:
|
| accessors |
|
| mutators |
|
| classifiers |
|
| constructors |
|
| destructors |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
