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
10 questions
C++ set4
Quiz
•
University
12 questions
C++ Programming Language
Quiz
•
University
10 questions
ATP-lab viva
Quiz
•
University
15 questions
Technoquiz..3
Quiz
•
University
10 questions
Coding
Quiz
•
9th Grade
10 questions
TYPES OF COMPUTER SYSTEM ERROR
Quiz
•
9th Grade
11 questions
Mecanografia M 2.0
Quiz
•
6th Grade
17 questions
Python Review Module 16 - Searching Sorting Algorithm
Quiz
•
University
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
12 questions
Dividing Fractions
Quiz
•
6th Grade
9 questions
1. Types of Energy
Quiz
•
6th Grade
18 questions
Main Idea & Supporting Details
Quiz
•
5th Grade
20 questions
Parts of Speech
Quiz
•
3rd - 6th Grade