Do you know some Java basics?
Quiz
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Hard
Dior R. Nguyen (GCC Instructor)
Used 3+ times
FREE Resource
Enhance your content in a minute
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
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Microcontroller
Quiz
•
11th Grade - University
14 questions
Input, output and storage de
Quiz
•
8th Grade - Professio...
13 questions
9G4 CS Python Programming Sequence and Vocabs
Quiz
•
9th Grade
10 questions
1.8 Open Source & Closed Source TRUE or FALSE
Quiz
•
10th Grade
15 questions
Shared Data & Disaster Recovery
Quiz
•
11th Grade
10 questions
Cos’è la ROM?
Quiz
•
6th - 12th Grade
10 questions
hardware and software(g3)
Quiz
•
2nd - 10th Grade
10 questions
EMPTECH L4 Q3
Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
