
Java Test-2
Quiz
•
Professional Development
•
Professional Development
•
Practice Problem
•
Hard
Programming House
Used 3+ times
FREE Resource
Enhance your content in a minute
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the best description of a "relational operator"?
Comparison symbols used in logical expressions
Mathematical symbols used to calculate numeric results
Links that control the relationships between objects
None of these are true
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given two numbers A and B, which of the following expressions will be true when "A is less than B"?
A < B
A > B
A == B
A != B
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given two numbers A and B, which of the following expressions will be true when "A is equal to B"?
A != B
A == B
A = B
A.eq(B)
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Given the following code, what will be displayed when the program is run?
int A = 5; int B = 10;
System.out.print(A != B);
System.out.print(" ");
System.out.print(A < B);
true false
false false
true true
false true
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following expressions (A, B, C) is considered a logical expression?
A) 6 + 4
B) (6 + 4) >= 10
C) 4 < 10
A only
B and C only
A, B, and C
C only
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens if you do not follow an if() statement with opening and closing curly braces?
All following statements that are indented to the right are part of the if() body
This is a compile-time syntax error
You must follow immediately with another if() statement
The next statement only is part of the if() body
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the difference between the following three if() statements?
double sodaCost = 2.50;
if (sodaCost > 2.00)
System.out.println("I'll have water instead");
if (sodaCost > 2.00)
System.out.println("I'll have water instead");
if (sodaCost > 2.00)
System.out.println("I'll have water instead");
Only the second one is valid; the other two produce compile-time errors
Impossible to tell without running the program
The second two if() statements are nested inside the first and will only run if the first is true
All three work exactly the same way and produce the same output
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
41 questions
ITIL 4-4
Quiz
•
Professional Development
42 questions
Terik's Practice Test 3
Quiz
•
Professional Development
40 questions
Đề 4 - 20679 - 03/2021
Quiz
•
Professional Development
40 questions
Central Heating 6035-02 | Part 1
Quiz
•
Professional Development
40 questions
Đề MIT 41021.2 (14/8/2022)
Quiz
•
Professional Development
40 questions
Kwalifikacja SPL.01 (obsługa magazynów) 2024
Quiz
•
Professional Development
40 questions
BOYMAN BAB 3 - Penghargaan dan Gelar Kehormatan
Quiz
•
Professional Development
35 questions
URBAN DESIGN 3: ALE 2022
Quiz
•
Professional Development
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
