Java Programming Quiz

Java Programming Quiz

University

22 Qs

quiz-placeholder

Similar activities

CompSci unit 1 review

CompSci unit 1 review

7th Grade - University

19 Qs

Avaliação Parcial do 2º Bimestre

Avaliação Parcial do 2º Bimestre

University

20 Qs

Repaso Programacion I

Repaso Programacion I

University

18 Qs

Round 1

Round 1

University

20 Qs

Основы Python

Основы Python

University

19 Qs

Algo-Unlock

Algo-Unlock

University

20 Qs

Розробка клієнт-серверних застосувань

Розробка клієнт-серверних застосувань

University

25 Qs

Java Programming Quiz for swapna

Java Programming Quiz for swapna

University

20 Qs

Java Programming Quiz

Java Programming Quiz

Assessment

Quiz

Other

University

Hard

Created by

Niveditha N

Used 2+ times

FREE Resource

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

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?