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
Principles of Programming

Quiz
•
KG - University
18 questions
Python basics

Quiz
•
7th - 10th Grade
10 questions
Classification of programming languages

Quiz
•
10th Grade
12 questions
Python Print Statement

Quiz
•
6th - 10th Grade
10 questions
How does a complier, interpreter and CPU work video

Quiz
•
9th - 12th Grade
19 questions
Computer Languages

Quiz
•
12th Grade
18 questions
Computers & How They Work

Quiz
•
9th - 12th Grade
12 questions
Translators

Quiz
•
10th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
Discover more resources for Computers
50 questions
Trivia 7/25

Quiz
•
12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
6 questions
RL.10.1 Cite Evidence

Quiz
•
10th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
14 questions
Algebra 1 SOL Review #1

Quiz
•
9th Grade