Java Programming Quiz

Java Programming Quiz

University

22 Qs

quiz-placeholder

Similar activities

Microeconomics MIDTERM

Microeconomics MIDTERM

University

20 Qs

QUIZ WEEK 6

QUIZ WEEK 6

University

20 Qs

General Awareness

General Awareness

University

20 Qs

3 Branches of Government

3 Branches of Government

6th Grade - University

18 Qs

Quiz ODC-Jan 2021

Quiz ODC-Jan 2021

University

20 Qs

Chapter 1- Quiz 3

Chapter 1- Quiz 3

University

20 Qs

Control systems I(Viscosity controller & OMD)

Control systems I(Viscosity controller & OMD)

University

20 Qs

Fishing Methods II

Fishing Methods II

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?