Do you know some Java basics?

Do you know some Java basics?

9th - 12th Grade

14 Qs

quiz-placeholder

Similar activities

Networking Quiz

Networking Quiz

8th - 9th Grade

15 Qs

HARDWARE AND SOFTWARE

HARDWARE AND SOFTWARE

2nd - 10th Grade

10 Qs

HTML

HTML

8th - 12th Grade

15 Qs

Q1 M 2 - TOPIC 2 / Check your understanding

Q1 M 2 - TOPIC 2 / Check your understanding

10th Grade

10 Qs

ICT - Networks and communication

ICT - Networks and communication

9th Grade

11 Qs

Traffic Light Project Quiz

Traffic Light Project Quiz

9th Grade

17 Qs

Cell Phone Vocabulary

Cell Phone Vocabulary

9th - 12th Grade

12 Qs

BP TIK 1

BP TIK 1

10th Grade

10 Qs

Do you know some Java basics?

Do you know some Java basics?

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Hard

Created by

Dior R. Nguyen (GCC Instructor)

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Media Image

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

Media Image

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?