
Assessment Java Programming Skills
Authored by Christiancarmine ESPOSITO
Computers
University
Used 16+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code
import java.util.Arrays;
import java.util.Comparator;
public class ComparatorTest {
public static void main(String args[]){
String[] ar= {“c”,”d”,”b”,”a”,”e”};
InnerClass in=new InnerClass();
Arrays.parallelSort(ar, in);
for(String str : ar)
System.out.println(str +””);
System.out.println(Arrays.binarySearch(ar, “b”));
}
static class InnerClass implements Comparator<String>{
public int compare(String s1, String s2){
return s2.compareTo(s1);
}
}
}
e d c b a -1
a b c 0 e d
d b c e a 1
e b a d c
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code
import java.util.LinkedHashSet;
import java.util.Set;
public class LinkedHashSetTest {
public static void main (String args[]){
Set s=new LinkedHashSet();
s.add(“1”);s.add(1);
s.add(3);
s.add(2);
System.out.println(s);
}
}
[1, 1, 2, 3]
[1, 2, 2 3[
[1, 1, 3, 2]
[1, 2, 3]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code
import java.util.ArrayList;
import java.util.List;
public class ListDemo {
public static void main (String args[]) {
List<Integer> list=new ArrayList<Integer>();
list.add(2); list.add(3); m(list);
public static void m(List<Number> list) {
System.out.println(list);
}
}
}
3
3.0
Compile time exception
Runtime exception
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of those doesn’t have an index based structure?
List
Set
Map
Vector
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
java.util.Collections is a:
Class
Interface
Object
None of the above
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Iterator, hasMoreElements() method of Enumeration has been changed to:
hasNextElement()
isNext()
hasNext()
name remains same
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What of the following is the default value of a local variable?
null
0
Depends upon the type of variable
Not assigned
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Quizz_Algoritma, Pemrograman, dan RPL_Accifence
Quiz
•
University
15 questions
Monday Week#2
Quiz
•
University
10 questions
El Paradigma Orientado a Objetos: Una Introducción Mediante Java
Quiz
•
University
15 questions
Algoritma dan Pemrograman Bab 1
Quiz
•
University
7 questions
ESBrotherX_Medical AI_Lecture
Quiz
•
University
10 questions
BASIC PROGRAMMING QUIZ by Group 5
Quiz
•
University
10 questions
AR/VR workshop phase 2
Quiz
•
University
15 questions
7-mavzu. Python va MySQLda ma’lumotlarni tanlash va o‘chirish
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade