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
13 questions
JavaScript Variables

Quiz
•
3rd Grade - University
16 questions
micro:bit

Quiz
•
7th - 9th Grade
15 questions
H466 - Paradigms and High-Level Programming Languages

Quiz
•
12th Grade - University
10 questions
Creative tech summative exam

Quiz
•
9th - 12th Grade
10 questions
JavaScript Quiz 1

Quiz
•
9th - 12th Grade
11 questions
GCSE Computer Science Paper 2: Topic 5

Quiz
•
10th Grade
15 questions
8.2.5 History of Programming Languages

Quiz
•
9th Grade
10 questions
QUARTER3 MOD 1 TO 5

Quiz
•
10th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

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

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade