Java Programming Quiz

Java Programming Quiz

University

57 Qs

quiz-placeholder

Similar activities

Mastering Java Interfaces

Mastering Java Interfaces

University

61 Qs

Java random sites

Java random sites

University

59 Qs

Java OOP principles Summative test

Java OOP principles Summative test

University

60 Qs

SAS | Week 01

SAS | Week 01

University

57 Qs

Java 6 Final

Java 6 Final

University

60 Qs

Debugging and Exception Handling Quiz

Debugging and Exception Handling Quiz

University

53 Qs

Health and safety

Health and safety

University

55 Qs

Struktur Data 24/25

Struktur Data 24/25

University

60 Qs

Java Programming Quiz

Java Programming Quiz

Assessment

Quiz

Other

University

Medium

Created by

Niveditha N

Used 1+ times

FREE Resource

57 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which method is used to sort an array in Java?

Collections.sort()

Arrays.sort()

array.sort()

sort.array()

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is a valid declaration of a 2D array?

int[][] arr = new int[2][3];

int arr[][] = new int[2,3];

int arr[] = new int[2][3];

int arr[2][3];

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What does this code print? int[][] matrix = { {1, 2}, {3, 4} }; System.out.println(matrix[1][1]);

2

3

4

1

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which loop is best for traversing arrays in Java?

while

do-while

for

goto

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the output of the following code? String s1 = "Java"; String s2 = "Java"; System.out.println(s1 == s2);

true

false

error

null

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which method is used to compare two strings by ignoring case?

equals()

equalsIgnoreCase()

compareTo()

compareIgnoreCase()

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is used to concatenate two strings?

concat()

append()

+ operator

All of the above

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?