What will the following code segment print?
System.out.println(4 / 5);
Java Lesson 9
Quiz
•
Other
•
5th Grade - University
•
Medium
Rohit Sharma
Used 1+ times
FREE Resource
12 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
What will the following code segment print?
System.out.println(4 / 5);
2.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
What will the following code segment print?
System.out.println(4 * 2.0);
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the value in variable x after this code segment is executed?
String x = "" + 4 + 2;
"6"
"6.0"
There will be a runtime error
There will be a syntax error
"42"
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the value in variable x after this code segment is executed?
int x = (int) 5.0 / 2;
2
2.5
There will be a runtime error
There will be a syntax error
3
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the value in variable x after this code segment is executed?
double x = (double) 5 / (int) 2
2
2.5
There will be a runtime error
There will be a syntax error
2.0
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the value in variable x after this code segment is executed?
double x = (double) 5 / (int) 2
2
2.5
There will be a runtime error
There will be a syntax error
2.0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
11 questions
Mecanografia M 2.0
Quiz
•
6th Grade
13 questions
Java Programming Quiz
Quiz
•
University
10 questions
Java Set 2
Quiz
•
University
9 questions
Section 1 | Q1
Quiz
•
University
10 questions
Java set3
Quiz
•
University
10 questions
ATP-lab viva
Quiz
•
University
12 questions
'PYTHON _WORLD'
Quiz
•
6th - 8th Grade
10 questions
Coding
Quiz
•
9th Grade
25 questions
Equations of Circles
Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)
Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System
Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice
Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers
Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons
Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)
Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review
Quiz
•
10th Grade
25 questions
Equations of Circles
Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)
Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System
Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice
Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers
Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons
Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)
Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review
Quiz
•
10th Grade