
JAVA
Quiz
•
Architecture
•
4th Grade
•
Practice Problem
•
Hard
kalyani boyina
Used 2+ times
FREE Resource
Enhance your content in a minute
38 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java code?
class increment {
public static void main(String args[])
{
int g = 3;
System.out.print(++g * 8);
}
}
A) 32
B) 33
C) 24
D) 25
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java program?
class output {
public static void main(String args[]){
double a, b,c;
a = 3.0/0;
b = 0/4.0;
c=0/0.0;
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
}
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java program?
class variable_scope
{
public static void main(String args[])
{
int x;
x = 5;
{
int y = 6;
System.out.print(x + " " + y);
}
System.out.println(x + " " + y);
}
}
a) Compilation error
b) Runtime error
c) 5 6 5 6
d) 5 6 5
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java program?
class leftshift_operator
{
public static void main(String args[])
{
byte x = 64;
int i;
byte y;
i = x << 2;
y = (byte) (x << 2);
System.out.print(i + " " + y);
}
}
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java code?
class box
{
int width;
int height;
int length;
}
class main
{
public static void main(String args[])
{
box obj = new box();
obj.width = 10;
obj.height = 2;
obj.length = 10;
int y = obj.width * obj.height * obj.length;
System.out.print(y);
}
}
100
400
200
12
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is Truncation in Java?
Floating point value is assigned to floating type
Floating point value assigned to integer type.
Integer point value assigned to integer type
Integer point value assigned to floating type
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java program?
class Output
{
public static void main(String args[])
{
int arr[] = {1, 2, 3, 4, 5};
for ( int i = 0; i < arr.length - 2; ++i)
System.out.print(arr[i] + " ");
}
}
Access all questions and much more by creating a free account
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
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Architecture
15 questions
Equivalent Fractions
Quiz
•
4th Grade
10 questions
Groundhog Day Trivia Questions
Interactive video
•
3rd - 6th Grade
9 questions
Point of View
Quiz
•
3rd - 4th Grade
10 questions
Groundhog Behavior and Hibernation Facts
Interactive video
•
3rd - 5th Grade
10 questions
Understanding Poetry and Literary Devices
Interactive video
•
4th - 8th Grade
77 questions
Mixed Multiplication and Division Facts
Quiz
•
4th Grade
10 questions
Understanding Equivalent Fractions
Interactive video
•
3rd - 5th Grade
19 questions
Equivalent Fractions
Quiz
•
4th Grade
