Question: Question 17 (0.625 points) Java fields are also known as: Question 17 options: none of the above constructors instance variables constants accessors Question 18 (0.625
Question 17 (0.625 points)
Java fields are also known as:
Question 17 options:
|
| none of the above |
|
| constructors |
|
| instance variables |
|
| constants |
|
| accessors |
Question 18 (0.625 points)
Which characteristics distinguish a constructor from other methods? (Select all that apply.)
Question 18 options:
|
| The same name as the class |
|
| No return type |
|
| No parameters |
|
| A return type of void |
Question 19 (0.625 points)
public class Dog { private int age; } The lifetime of age is:
Question 19 options:
|
| the same as the lifetime of a Dog object to which it belongs |
|
| the same as the lifetime of the Dog class |
|
| the duration of the program |
|
| not able to be determined |
|
| not defined |
Question 20 (0.625 points)
If an instance variable is declared as:
private int age;
it will be set to a default value of:
Question 20 options:
|
| null |
|
| blanks |
|
| 1 |
|
| 0 |
|
| none of the above |
Question 21 (0.625 points)
Consider this code with line numbers at left:
1 public class Something { 2 private int val; 3 4 public Something() { 5 val = 0; 6 } 7 8 public int getVal() { 9 return val; 10 } 11 } What is lines 4-6?
Question 21 options:
|
| a class |
|
| a constructor |
|
| a method |
|
| an object |
|
| a field |
Question 22 (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 constructor shown?
Question 22 options:
|
| private |
|
| Product |
|
| getId |
|
| public |
|
| id |
Question 23 (0.625 points)
Classes define types.
Question 23 options:
| True | |
| False |
Question 24 (0.625 points)
____________ is the ability to ignore details of a problem and focus on the higher level of the problem.
Question 24 options:
|
| Concatenation |
|
| Abstraction |
|
| Overloading |
|
| Debugging |
|
| Initialization |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
