
Java Program

Quiz
•
Computers
•
University
•
Hard
Dhilip Kumar V TTS2750
Used 8+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the output
class Test {
public static void main(String args[]) {
int arr[2];
System.out.println(arr[0]);
System.out.println(arr[1]);
}
}
Compile error
Exception
Garbage Value
Garbage Value
0
0
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output of following Java program?
class Test{
public static void main (String[] args) {
int arr1[] = {1, 2, 3};
int arr2[] = {1, 2, 3};
if (arr1 == arr2)
System.out.println("Same");
else
System.out.println("Not same");
}}
Same
Not same
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Demo1
{
public static void main(String args[])
{
int i[] = new int[10];
System.out.println(i[10]);
}
}
0
Garbage Value
Out-of-bounds exception
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be output of below program?
public class Test {
public static void main(String[] args) {
int x = 10*20-20;
System.out.println(x);
}
}
Runtime Error
Prints 180
Prints 0
None of the above
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output for the following statement:
System.out.print("1"+"1");
11
2
Error Message
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Indicate the actual output of the statements below:
int thisYear = 2020;
System.out.println("The current year is "+thisYear);
The current year is thisYear
The current year is 2020
No output; an error exists
The current year is
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
int x= 10;
int y = 20;
int z = x + y;
System.out.println(z);
Guess the output.
1020
10 20
30
"10 20"
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Control Statements in JAVA

Quiz
•
University
14 questions
Java Operators

Quiz
•
University
10 questions
Talent Next Java MCQ-1

Quiz
•
University
11 questions
Array

Quiz
•
University
10 questions
Temel Java Bilgisi Ölçme Testi

Quiz
•
University
10 questions
java quiz on Encapsulation and Abstraction

Quiz
•
University
15 questions
Java Quiz set 3

Quiz
•
University
7 questions
Java Programming Game

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University