Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Module 1 Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Java is currently owned by which company?

a)

Microsoft

b)

Sun Microsystems

c)

Oracle

d)

IBM

2.

What makes Java platform-independent?

a)

It uses HTML

b)

It is only used in Windows

c)

You write the program once and run it on multiple platforms

d)

It doesn’t require compilation

3.

Which of the following is NOT an example of where Java can be used?

a)

Android apps

b)

Web applications

c)

Database creation only

d)

Desktop applications

4.

Which symbol starts a single-line comment in Java?

a)

/* comment */

b)

// comment

c)

<!-- comment -->

d)

** comment **

5.

What is the data type used to store a single character in Java?

a)

String

b)

char

c)

boolean

d)

int

6.

Which operator is used to find the remainder of a division?

a)

/

b)

%

c)

*

d)

#

7.

In postfix form (x++), when is the value of the variable increased?

a)

Before it’s used in the expression

b)

After it’s used in the expression

c)

During program compilation

d)

Never

8.

What does the assignment operator (=) do in Java?

a)

Checks if two values are equal

b)

Assigns a value to a variable

c)

Adds two numbers

d)

Compares two strings

9.

Which of the following is an example of string concatenation in Java?

a)

"Hello" - "World"

b)

"Hello" + "World"

c)

"Hello" * "World"

d)

concat("Hello","World") only

10.

Which class is most commonly used in Java to get user input?

a)

InputReader

b)

Console

c)

Scanner

d)

Reader

11.

Which method from the Scanner class reads an integer value?

a)

nextInt()

b)

nextLine()

c)

readInt()

d)

scanInt()

12.

Which Java data type can store values like true or false?

a)

String

b)

boolean

c)

int

d)

char

13.

What will System.out.println("Hi " + "There"); output?

a)

Hi + There

b)

Hi There

c)

"Hi There"

d)

Error

14.

Which of the following reads an entire line of text input using Scanner?

a)

next()

b)

nextLine()

c)

nextWord()

d)

readLine()

15.

Which of the following is used for documentation comments in Java?

a)

// comment //

b)

/** comment */

c)

<!-- comment -->

d)

** comment **