Latest Update
A variable declared as type double can store _____________________. ✔️✔️a 64-bit value used
to represent numbers with fractional parts
A graphical interface used to develop and debug Java programs is called:
_______________________________. ✔️✔️an Integrated Development Environment (IDE)
Assume the following (int) values for a set of variables:
a = 5; b = 17; c = 27; d = -1;
Then, does the following boolean expression evaluate as true or false?
((a < 5) && (b > 10)) || ((c < 3) || (d < 0)) ✔️✔️true
If you want to compare the String variable myvar and the literal "Yes" which boolean expression
would you use? __________________________ ✔️✔️("Yes".equals(myvar))
Which of the following can be used in the boolean condition of a Java if statement?
___________________. ✔️✔️All of the above
The following are Java loop control structures: __________________________. ✔️✔️all of the
above
A do-while loop always executes _____________________. ✔️✔️one or more times
Consider the following code fragment:
for (int i=5; i<=7; ++i) { System.out.println(i); }
The code will print: ✔️✔️5
, 6
7
Consider the following code fragment:
for (int i=0; i<10; ++i) {
for (int j=0; j<10; ++j) {
System.out.println("Hello");
}
}
How many times does the code fragment print the word "Hello"? ✔️✔️100 times
Which of the following means the same as object? ✔️✔️instance
Which of the following means the same as instance variable? ✔️✔️field
Which of the following is the most likely scenario for a specific class? ✔️✔️Its data fields are
private and its methods are public.
Assume that you have created a class named Dog that contains a data field named weight and
an instance method named setWeight(). Further assume that the setWeight() method is public
and accepts a numeric parameter named pounds. Which of the following statements correctly
sets a Dog's weight within the setWeight() method? ✔️✔️weight = pounds
Which method is automatically called when a Java object is instantiated? ✔️✔️Constructor
A Java object can be a field in another Java object. ✔️✔️True
Which of the following pairs is an example of an is-a relationship? ✔️✔️Laptop, Computer