
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] + " ");
}
}
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Architecture
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
15 questions
Subject-Verb Agreement
Quiz
•
4th Grade
21 questions
Factors and Multiples
Quiz
•
4th Grade
20 questions
Prepositions and prepositional phrases
Quiz
•
4th Grade
13 questions
Point of View
Quiz
•
4th Grade
10 questions
Charlie Brown's Thanksgiving Adventures
Interactive video
•
2nd - 5th Grade
19 questions
Energy, Electricity,Conductors and Insulators
Quiz
•
4th Grade
14 questions
Context Clues
Quiz
•
4th - 6th Grade
