
JavaDemo1
Authored by Shefali Arora
Computers
Professional Development
Used 6+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which one of these lists contains only Java programming language keywords?
class, if, void, long, Int, continue
goto, instanceof, native, finally, default, throws
try, virtual, throw, final, volatile, transient
strictfp, constant, super, implements, do
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is a valid keyword in java?
interface
string
Float
unsigned
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is a valid declarations of a String?
String s2 = 'null';
String s1 = null;
String s3 = (String) 'abc';
String s4 = (String) '\ufeed';
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code:
class Test {
public static void main(String[] args) {
for(int i = 0; 1; i++) {
System.out.println("Hello");
break;
}
}
}
Prints Hello once
Prints Hello infinite times
Prints nothing
Compiler error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
class Test {
public static void main(String[] args) {
for(int i = 0; 1; i++) {
System.out.println("Hello");
break;
}
}
}
0
20
Compiler Error
Prints Nothing
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
class Main {
public static void main(String args[]) {
try {
throw 10;
}
catch(int e) {
System.out.println("Got the Exception " + e);
}
}
}
Got the Exception 10
Got the Exception 0
Compiler error
None of these
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following?
class Main
{public static void main (String[] args) {
try
{
int x = 0;
int y = 5 / x;
}
catch (Exception e)
{
System.out.println("Exception");
}
catch (ArithmeticException ae)
{
System.out.println(" Arithmetic Exception");
}
System.out.println("finished");
}};
What will be the output of the following?
class Main
{public static void main (String[] args) {
try
{
int x = 0;
int y = 5 / x;
}
catch (Exception e)
{
System.out.println("Exception");
}
catch (ArithmeticException ae)
{
System.out.println(" Arithmetic Exception");
}
System.out.println("finished");
}};
finished
Compilation error
Exception
Arithmetic exception
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
13 questions
Functions
Quiz
•
5th Grade - Professio...
10 questions
IOT Introduction Quiz
Quiz
•
Professional Development
12 questions
FP - Semana 6
Quiz
•
Professional Development
10 questions
Kuis Array
Quiz
•
Professional Development
10 questions
Kuis Pelatihan Computational Thinking
Quiz
•
Professional Development
15 questions
android
Quiz
•
Professional Development
16 questions
DP-900 MÓDULO 4 pt-br
Quiz
•
Professional Development
10 questions
Presentador EMAZE
Quiz
•
Professional Development
Popular Resources on Wayground
8 questions
Spartan Way - Classroom Responsible
Quiz
•
9th - 12th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
14 questions
Boundaries & Healthy Relationships
Lesson
•
6th - 8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
3 questions
Integrity and Your Health
Lesson
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
9 questions
FOREST Perception
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
Discover more resources for Computers
15 questions
LOTE_SPN2 5WEEK3 Day 2 Itinerary
Quiz
•
Professional Development
6 questions
Copy of G5_U6_L5_22-23
Lesson
•
KG - Professional Dev...
10 questions
March Quiz
Quiz
•
Professional Development
5 questions
Copy of G5_U6_L8_22-23
Lesson
•
KG - Professional Dev...
10 questions
suffixes FUL OR LESS
Quiz
•
Professional Development