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, 23.06.2019 03:30
Ihave a singular monitor that is a tv for my computer. recently, i took apart my computer and put it back together. when i put in the hdmi cord and booted the computer to see if it worked, the computer turned on fine but the screen was blue with "hdmi no signal." i've tried everything that doesn't require buying spare parts, any answer is appreciated!
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
From excel to powerpoint, you can copy and paste a. cell ranges and charts, one at a time. b. cell ranges and charts, simultaneously. c. charts only. d. cell ranges only.
Answers: 3
question
Computers and Technology, 23.06.2019 18:50
Ais a picture icon that is a direct link to a file or folder
Answers: 1
question
Computers and Technology, 24.06.2019 06:50
What are the things you are considering before uploading photos on social media?
Answers: 1
You know the right answer?
Java Programming I Review Quiz 1. What is Java SE? (1 point)
(1 pt) Java Standard Edition
Questions
question
History, 12.02.2021 21:40
question
Mathematics, 12.02.2021 21:40
question
Mathematics, 12.02.2021 21:40
question
Mathematics, 12.02.2021 21:40
question
Chemistry, 12.02.2021 21:40
question
Mathematics, 12.02.2021 21:40
Questions on the website: 13722363