
AD_Java Basics
Quiz
•
Computers
•
Professional Development
•
Practice Problem
•
Hard
ARTHI C1514
Used 1+ times
FREE Resource
Enhance your content in a minute
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Predict the output
int x = 10;
if (x = 20) {
System.out.println("True");
} else {
System.out.println("False");
}
True
False
Compilation Error
Runtime error
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
for (int i = 0; i < 5; i++);
{
System.out.println("Hello");
}
How many times does "Hello" print?
0 times
1 time
5 times
Compilation error
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Predict the output:
public class Test {
static public void main(String[] args) {
System.out.println("Executed");
}
}
Error – Invalid main method
Executes and prints "Executed"
Error – Missing return type
JVM throws exception
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Predict the output:
public class Demo {
public static void main(String args) {
System.out.println("Run");
}
}
Prints "Run"
Compilation error
Runs but no output
JVM error: main method not found
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Predict the output:
class A {
int x = 10;
}
class B extends A {
int x = 20;
}
public class Test {
public static void main(String[] args) {
A obj = new B();
System.out.println(obj.x);
}
}
10
20
Compilation error
Runtime error
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Predict the output:
class Parent {
private void show() {
System.out.println("Parent");
}
}
class Child extends Parent {
void show() {
System.out.println("Child");
}
}
public class Main {
public static void main(String[] args) {
Parent p = new Child();
p.show();
}
}
Prints "Child"
Prints "Parent"
Compilation error
Runtime error
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Predict the output:
int arr[] = new int[5];
System.out.println(arr[0]);
0
Garbage value
Compilation error
Runtime error
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
10 questions
Estructuras Selectivas C++
Quiz
•
7th Grade - Professio...
15 questions
Scratch Text Operators
Quiz
•
KG - Professional Dev...
10 questions
Redux
Quiz
•
Professional Development
18 questions
DECI - Week 14 - round
Quiz
•
Professional Development
15 questions
Supervised and unsupervised learning
Quiz
•
Professional Development
11 questions
Capítulo 3
Quiz
•
University - Professi...
10 questions
Multiple Regression Analysis
Quiz
•
University - Professi...
10 questions
C++ quiz
Quiz
•
10th Grade - Professi...
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 Computers
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...
