Introduction to Java Quiz

Introduction to Java Quiz

11th Grade

15 Qs

quiz-placeholder

Similar activities

STATIC KEYWORD IN JAVA

STATIC KEYWORD IN JAVA

9th - 12th Grade

18 Qs

Java, part I

Java, part I

11th Grade - University

20 Qs

Arithmetic Types Declare Initialize Relation Logical Ops

Arithmetic Types Declare Initialize Relation Logical Ops

9th Grade - University

16 Qs

Java Arrays Basic

Java Arrays Basic

10th - 12th Grade

15 Qs

Java Script Quiz

Java Script Quiz

9th - 12th Grade

15 Qs

For Loops

For Loops

9th - 12th Grade

10 Qs

Latihan Interface

Latihan Interface

9th - 12th Grade

10 Qs

Java If/else/ switch

Java If/else/ switch

9th - 12th Grade

20 Qs

Introduction to Java Quiz

Introduction to Java Quiz

Assessment

Quiz

Computers

11th Grade

Easy

Created by

Mrs. Latimer

Used 4+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to declare a variable in Java?

`int number = 5;`

`int number = "5";`

`int number = 5.0;`

`int number = '5';`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid Java data type?

`integer`

`String`

`character`

`real`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet? ```java System.out.println(10 + 20); ```

`30`

`1020`

`10 + 20`

`Error`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a control structure in Java?

`if`

`loop`

`switch`

`both A and C`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default value of a boolean variable in Java?

`true`

`false`

`0`

`null`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is used to read input from the user in Java?

`Scanner`

`InputReader`

`BufferedReader`

`ConsoleReader`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the expression `5 % 2` in Java?

`2`

`1`

`0`

`5`

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?