Quiz on Java Collection

Quiz on Java Collection

University

20 Qs

quiz-placeholder

Similar activities

collections

collections

University

20 Qs

COMP_Technical Quiz_Round 2

COMP_Technical Quiz_Round 2

12th Grade - University

20 Qs

Java Flashcards

Java Flashcards

University

16 Qs

Servlets

Servlets

University

15 Qs

Recap on HTML and CSS

Recap on HTML and CSS

University

16 Qs

Technical Quiz - INSIGHT 2K23

Technical Quiz - INSIGHT 2K23

University

23 Qs

Fundamentals of Computer Science

Fundamentals of Computer Science

University

15 Qs

Collections C#

Collections C#

University

20 Qs

Quiz on Java Collection

Quiz on Java Collection

Assessment

Quiz

Computers

University

Hard

Created by

Jagadish Sahoo

Used 10+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of these packages contain all the collection classes?

java.lang

java.util

java.net

java.awt

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of these classes is not part of Java’s collection framework?

Maps

Array

Stack

Queue

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of this interface is not a part of Java’s collection framework?

List

Set

SortedMap

SortedList

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of these methods deletes all the elements from invoking collection?

clear()

reset()

delete()

refresh()

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is Collection in Java?

A group of objects

A group of classes

A group of interfaces

None of the mentioned

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. import java.util.*;
  2. class Array

  3. {

  4. public static void main(String args[])

  5. {

  6. int array[] = new int [5];

  7. for (int i = 5; i > 0; i--)

  8. array[5-i] = i;

  9. Arrays.fill(array, 1, 4, 8);

  10. for (int i = 0; i < 5 ; i++)

  11. System.out.print(array[i]);

  12. }

  13. }

12885

12845

58881

54881

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. import java.util.*;
  2. class Bitset

  3. {

  4. public static void main(String args[])

  5. {

  6. BitSet obj = new BitSet(5);

  7. for (int i = 0; i < 5; ++i)

  8. obj.set(i);

  9. obj.clear(2);

  10. System.out.print(obj);

  11. }

  12. }

{0, 1, 3, 4}

{0, 1, 2, 4}

{0, 1, 2, 3, 4}

{0, 0, 0, 3, 4}

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?