subject

Java Programming I Review Quiz 1. What is Java SE? (1 point)
(1 pt) Java Standard Edition
(0 pts) Java Soware Editor
(0 pts) Java Scientific Edition
(0 pts) Java Soware Emulator
1 /1 point
2. Which of the following shows a correct header for the main method of a Java program? (1 point)
(0 pts) public static void main(String args)
(0 pts) public abstract void main(String[] args)
(1 pt) public static void main(String[] args)
(0 pts) public static int main(String[] args)
1 /1 point
3. Which of the following statements creates a constant in Java? (1 point)
(0 pts) int const = 5;
(0 pts) const int x = 5;
(1 pt) final int x = 5;
(0 pts) const x = 5;
0 /1 point
4. Which of the following statements displays 17? (1 point)
(0 pts) System. out. println(2 * 4 + 3 * 2 + 1);
(0 pts) System. out. println((2 * 4 + 3) * 2 + 1);
(1 pt) System. out. println(2 * 4 + (3 * (2 + 1)));
(0 pts) System. out. println(2 * (4 + 3 * 2) + 1);
1 /1 point
If x is an int and the original value of x is 5, which of the following statements assigns an even value to x?
5. (1 point)
11/12/2020 Java Programming I Review Quiz
file:///C:/Users/bweak/Desktop/Java Programming I Review Quiz. html 2/5
(0 pts) x += 2;
(0 pts) x /= 3;
(1 pt) x %= 3;
(0 pts) x *= 3;
1 /1 point
6. If x is an int, which expression will always evaluate to true if x is evenly divisible by 5? (1 point)
(0 pts) x == 5
(0 pts) x % 2 == 5
(0 pts) x % 2 == 0
(1 pt) x % 5 == 0
1 /1 point
7. Consider the following declarations.
int y = 5;
int z = 10;
Which of the following expressions evaluates to true?
(1 point)
(0 pts) y > 5 && z >= 10
(0 pts) z / y >= 2 && y * 2 > z
(1 pt) y – z > 0 || y * 4 == z * 2
(0 pts) y + z == z + y && z – y == y - z
0 /1 point
8. Consider the following code.
int x = 2;
switch (x) {
case 1: x += 3; break;
case 2: x += 5; break;
case 3: x += 7; break;
default: x += 10;
}
Aer the switch statement, what is the value of x?
(1 point)
(0 pts) 2
(0 pts) 5
(1 pt) 7
(0 pts) 24
0 /1 point
11/12/2020 Java Programming I Review Quiz
file:///C:/Users/bweak/Desktop/Java Programming I Review Quiz. html 3/5
9. If y refers to an array of int values with seven elements, and all of those elements have been given a
value of 5, which statement would change the last element to a 2?
(1 point)
(0 pts) y[7] = 2
(1 pt) y[6] = 2
(0 pts) y[2] = 6
(0 pts) y[2] = 7
1 /1 point
10. Consider the following declaration.
int[] two = {{1, 2, 3}, {4, 5}};
Which arithmetic expression evaluates to a value of 8?
(1 point)
(0 pts) two[3] + two[2]
(0 pts) two[2] + two[1]
(0 pts) two[1][3] + two[2][2]
(1 pt) two[0][2] + two[1][1]
1 /1 point
11. Consider the following method.
public static void print(int a, int b) {
System. out. println("The sum is " + (a + b));
}
If the print method is in the same class as the main method and there are no other methods named
print, which of the following statements, called from the main method, will not cause a compiler
error?
(1 point)
(0 pts) System. out. println(print(2, 3));
(0 pts) System. out. println(print(2 + 3));
(1 pt) print(2, 3);
(0 pts) print(2 + 3);
1 /1 point
12. Which of the following expressions correctly and most accurately calculates the area of a circle with
radius r?
(1 point)
(1 pt) Math. pow(r, 2) * Math. PI
(0 pts) Math. power(r, 2) * Math. PI
(0 pts) Math. pow(2, r) * Math. PI
(0 pts) Math. exp(r, 2) * Math. PI
1 /1 point
13. Consider the following code.
public class Amazing {
int x;
int y;
}
Which of the following shows a statement that will create an instance of class Amazing and assign its
reference to a reference variable?
(1 point)
(0 pts) Amazing a = new Amazing;
(1 pt) Amazing a = new Amazing();
(0 pts) Amazing a = Amazing();
(0 pts) It is not possible to create an instance of class Amazing. It does not have a constructor.
1 /1 point
14. Consider the following code.
public class Employee {
private String firstName;
private String lastName;
private int empId;
}
Which of the following shows a constructor that, if added to class Employee, would allow a caller to
create an object and pass in values from the call that will be assigned to its instance variables?
(1 point)
(0 pts) public Employee() {
firstName = "Fred";
lastName = "Jones";
empId = 101;
}
(1 pt) public Employee(String a, String b, int c) {
firstName = a;
lastName = b;
empId = c;
}
(0 pts) public Employee("Fred", "Jones", 101) {
firstName = a;
lastName = b;
empId = c;
}
(0 pts) public Employee(String a, String b, int c) {
firstName = "Fred";
lastName = "Jones";
empId = 101;
}
1 /1 point
15.
11/12/2020 Java Programming I Review Quiz
file:///C:/Users/bweak/Desktop/Java Programming I Review Quiz. html 5/5
What is the output of the following code?
String name1 = "Chris";
String name2 = "Christine";
boolean b = name1.startsWith(name2);
boolean c = name1.charAt(4) == name2.charAt(7);
System. out. println(b + ", " + c);
(1 point)
(0 pts) true, true
(0 pts) true, false
(0 pts) false, true
(1 pt) false, false
0 /1 point

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
What must you do before formatting a paragraph?
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. peter has launched a website that features baby products. however, clients often find they are unable to access the website because the server is down. which feature of cybersecurity should peter focus on for his website? a. data authenticity b. data privacy c. data availability d. data integrity e. data encryption
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
The best definition of an idiom is a. a word or phrase that describes a noun b. a word or phrase describing a verb c. a phrase containing figurative language in which the word expresses a different idea from its exact meaning d. a phrase that compares two unlike objects or ideas
Answers: 2
You know the right answer?
Java Programming I Review Quiz 1. What is Java SE? (1 point)
(1 pt) Java Standard Edition
Questions
question
Mathematics, 04.06.2021 17:50
question
Spanish, 04.06.2021 17:50
question
Mathematics, 04.06.2021 17:50
question
Mathematics, 04.06.2021 17:50
question
History, 04.06.2021 17:50
question
Mathematics, 04.06.2021 17:50
Questions on the website: 13722363