
JAVA 2
Authored by Nagendrapatel Puppala
Arts
1st Grade
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following program?
public class Test implements Runnable {
public void run() { System.out.printf("%d", 3); }
public static void main(String[] args)
throws InterruptedException
{
Thread thread = new Thread(new Test());
thread.start();
System.out.printf("%d", 1);
thread.join();
System.out.printf("%d", 2);
}
}
123
213 or 231
132 or 312
321
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following program?
public class Test
{
private static int value = 20;
public int s = 15;
public static int temp = 10;
public static class Nested
{
private void display()
{
System.out.println(temp + s + value);
}
}
public static void main(String args[])
{
Test.Nested inner = new Test.Nested();
inner.display();
}
}
Compilation error
1020
101520
NONE
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following program?
import java.io.*;
public class Test
{
public void display() throws IOException
{
System.out.println("Test");
}
}
class Derived extends Test
{
public void display() throws IOException
{
System.out.println("Derived");
}
public static void main(String[] args) throws IOException
{
Derived object = new Derived();
object.display();
}
}
Test
Derived
Compilation error
Runtime error
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the Output of the following Java Program?
import java.util.LinkedList;
class Demo {
public void show()
{
LinkedList<String> list = new LinkedList<String>();
System.out.println(list.getClass());
}
} public class Main {
public static void main(String[] args)
{
Demo demo = new Demo();
demo.show();
}
}
class java.util.LinkedList
String
Compiler Error
NULL
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following program?
Java
public class Test extends Thread
{
public void run()
{
System.out.printf("Test ");
}
public static void main(String[] args)
{
Test test = new Test();
test.run();
test.start();
}
}
compile time error
runtime error
Test
Test Test
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
For the given code select the correct answer. public interface Test
{
public int calculate();
protected interface NestedInterface
{
public void nested();
}
}
Compile time error due to NestedInterface
Compile time error due to access modifier of NestedInterface
No Compile time error
NestedInterface cannot hold any function declaration.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following program?
public class Test {
public static void main(String[] args)
{
int[] arr = { 1, 2, 3, 4, 5 };
System.out.println(arr);
}
}
1
Compile-time error
12345
[I@Hashcode_in_Hexadecimal
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
15 questions
Economic Systems 3.15 - 2025 Quiz
Quiz
•
1st Grade - University
20 questions
Development Economics - II CIA 2025
Quiz
•
1st Grade
20 questions
Indian Economy
Quiz
•
1st Grade
15 questions
wrong
Quiz
•
1st Grade
20 questions
LS Woodwinds
Quiz
•
1st - 5th Grade
15 questions
Environmental Awareness Quiz
Quiz
•
1st - 5th Grade
25 questions
Shakespeare quizzards
Quiz
•
1st - 5th Grade
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 Arts
20 questions
Telling Time to the Hour and Half hour
Quiz
•
1st Grade
10 questions
Exploring Rosa Parks and Black History Month
Interactive video
•
1st - 5th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
13 questions
Fractions
Quiz
•
1st - 2nd Grade
20 questions
CVC Words
Quiz
•
KG - 1st Grade
15 questions
Place Value tens and ones
Quiz
•
1st Grade
16 questions
Money - Coins
Lesson
•
1st - 2nd Grade
20 questions
Halves and Fourths
Quiz
•
1st Grade