Java Programming Quiz

Java Programming Quiz

University

22 Qs

quiz-placeholder

Similar activities

Abstraction and Encapsulation

Abstraction and Encapsulation

University

20 Qs

Funções e Estruturas - Matrizes & Strings & Apontadores

Funções e Estruturas - Matrizes & Strings & Apontadores

9th Grade - Professional Development

24 Qs

React Day-4

React Day-4

University

20 Qs

2024.01 (01)

2024.01 (01)

University

20 Qs

Event Quiz

Event Quiz

11th Grade - Professional Development

20 Qs

QUIZ WEEK 6

QUIZ WEEK 6

University

20 Qs

Java Basics Quiz

Java Basics Quiz

University

20 Qs

TEMA 2  PROGRAMACION

TEMA 2 PROGRAMACION

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?