
Java Programming Quiz

Quiz
•
Other
•
University
•
Medium

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
Similar Resources on Wayground
60 questions
Quiz on Hazards, Fire, and Explosion

Quiz
•
University
59 questions
EE1 Unit 1

Quiz
•
University
54 questions
Câu hỏi về lập trình Android

Quiz
•
University
54 questions
Cuestionario Semana 2

Quiz
•
KG - Professional Dev...
53 questions
Java Loops Quiz

Quiz
•
University
62 questions
ENGINEERING ECONOMICS

Quiz
•
University
60 questions
Utkal University Quiz round 1

Quiz
•
University
60 questions
Metallurgy Quiz

Quiz
•
University
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade