Java Programming Quiz

Java Programming Quiz

University

22 Qs

quiz-placeholder

Similar activities

Section 1- Dear Mr. Henshaw

Section 1- Dear Mr. Henshaw

KG - University

18 Qs

Microsoft Excel

Microsoft Excel

KG - Professional Development

20 Qs

Goals of Pschology

Goals of Pschology

University

20 Qs

Planes

Planes

3rd Grade - University

20 Qs

FOH

FOH

University

20 Qs

RECALL ON WEEK 6: BUILDING FOUNDATIONS & ELEMENTS

RECALL ON WEEK 6: BUILDING FOUNDATIONS & ELEMENTS

University

20 Qs

THE SPANISH ERA

THE SPANISH ERA

4th Grade - University

20 Qs

Statistics Quiz

Statistics Quiz

University

20 Qs

Java Programming Quiz

Java Programming Quiz

Assessment

Quiz

Other

University

Practice Problem

Hard

Created by

Niveditha N

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

22 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is not a valid Java identifier?

_main

$value

9data

data_9

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the result of the following? System.out.println(10 + 20 + "30" + 40 + 50);

30304050

30204050

303050

303040

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is a correct way to assign a float value?

float f = 10.2;

float f = 10.2f;

float f = (float)10.2;

Both B and C

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will this print? int x = 5; System.out.println(x++ + ++x);

11

12

13

10

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the output? int x = 0; if (x == 0) x = 1; if (x == 1) x = 2; else x = 3; System.out.println(x);

2

3

1

Compile-time error

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will be the result of this code? int arr[] = new int[5]; System.out.println(arr[0]);

0

null

Garbage value

Error

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following returns true? String s1 = "Java"; String s2 = new String("Java");

s1 == s2

s1.equals(s2)

Both

None

Access all questions and much more by creating a free account

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

Already have an account?