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, 22.06.2019 10:20
Shown below is the start of a coding region within the fist exon of a gene. 5'--3' 3'--5' how many cas9 pam sequences are present?
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
Which statement is true of web-based social media? a.they allow consumers to interact with and update content. b.they cannot be updated easily, as compared to print media. c.they are expensive to produce and maintain, as compared to print and television. d.they can exist independent of the internet.
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
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
Mathematics, 20.10.2020 21:01
question
History, 20.10.2020 21:01
question
Mathematics, 20.10.2020 21:01
question
Geography, 20.10.2020 21:01
question
Mathematics, 20.10.2020 21:01
question
English, 20.10.2020 21:01
question
Chemistry, 20.10.2020 21:01
Questions on the website: 13722363