
Java Basics
Authored by satyagunadeep patta
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
31 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is JDK?
Java Development Kit
Java Distribution kit
Java Dont kit
Java Dona Kit
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? ```java System.out.println(2 + "2" + 2); ```
Answer explanation
The first 2 is treated as a number, but when concatenated with a string "2", it becomes a string. So the final result is '222'.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output? ```java System.out.println(10 / 0); ```
Answer explanation
Division by zero using integers throws an ArithmeticException in Java.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following? ```java for (int i = 0; i < 3; i++) { System.out.print(i + " "); } ```
Answer explanation
The loop runs while i < 3. It prints 0, 1, and 2, then stops.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this? ```java System.out.println("5 + 5 = " + 5 + 5); ```
Answer explanation
String concatenation happens first. "5 + 5 = " + 5 is "5 + 5 = 5", then adding another 5 gives "5 + 5 = 55".
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output? ```java System.out.println(2 * 3 + "4" + 5); ```
Answer explanation
2 * 3 is calculated first, giving 6. Then, '6' concatenates with "4" to become "64", and finally adding 5 gives "645".
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? ```java System.out.println(2 + "2" + 2); ```
Answer explanation
The first 2 is treated as a number, but when concatenated with a string "2", it becomes a string. So the final result is '222'.
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
27 questions
Cuestionario sobre Chatbots y Redes Sociales
Quiz
•
1st Grade - University
27 questions
Fundamentos de Programación en C
Quiz
•
University
28 questions
TIN 9 ÔN TẬP CUỐI KỲ 1
Quiz
•
9th Grade - University
27 questions
Foundations Farewell
Quiz
•
University
30 questions
Siskomdig
Quiz
•
University
35 questions
Kuis Aplikasi Kamus Digital
Quiz
•
8th Grade - University
29 questions
Administrasi Infrastruktur Jaringan
Quiz
•
University
26 questions
Quiz on Application Programming Interfaces (APIs)
Quiz
•
University
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