Do you know some Java basics?

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Dior R. Nguyen (GCC Instructor)
Used 3+ times
FREE Resource
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which statement is true about Java?
Java is a sequence-dependent programming language
Java is a code dependent programming language
Java is a platform-dependent programming language
Java is a platform-independent programming language
Answer explanation
Java is called ‘Platform Independent Language’ as it primarily works on the principle of ‘compile once, run everywhere’.
2.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of these cannot be used for a variable name in Java?
Identifier & keywords
Identifier
Keywords
None of the above
Answer explanation
Keywords are specially reserved words that can not be used for naming a user-defined variable.
For example: class, int, for, etc.
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the extension of java code files?
.txt
.java
.py
.html
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What will be the output of the following Java code?
16
24
32
48
Answer explanation
Operator ++ acts like a "plus 1" (increment), so g becomes 4 and when multiplied by 8 gives 32.
5.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the extension of compiled java classes?
.class
.java
.js
.code
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which exception is thrown when java is out of memory?
MemoryError
OutOfMemoryError
MemoryOutOfBoundsException
MemoryFullException
Answer explanation
The Xms flag has no default value, and Xmx typically has a default value of 256MB. A common use for these flags is when you encounter a java.lang.OutOfMemoryError.
7.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What will be the output of the following Java code?
a
b
abc
c
Answer explanation
String(chars) is a constructor of class string, it initializes string s with the values stored in character array chars, therefore s contains “abc”.
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Technical Terms - Internet (A-Z) - Flash

Quiz
•
12th Grade
10 questions
Coding a Game Quiz p4

Quiz
•
12th Grade
18 questions
MTA HTML CSS Session 1

Quiz
•
7th - 9th Grade
15 questions
Computer languages

Quiz
•
12th Grade
15 questions
Brief History of Computer

Quiz
•
12th Grade
16 questions
Year 7 - CPU, RAM, ROM

Quiz
•
7th - 11th Grade
12 questions
Coding and Robotics

Quiz
•
8th - 12th Grade
9 questions
ICT: Ice Breaker

Quiz
•
8th - 10th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade