adplus-dvertising

Welcome to the java util MCQs Page

Dive deep into the fascinating world of java util with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of java util, a crucial aspect of Java Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of java util, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Java Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through java util. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Java Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of java util. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

java util MCQs | Page 1 of 18

Explore more Topics under Java Programming

Q1.
Which of these standard collection classes implements a dynamic array?
Discuss
Answer: (c).ArrayList
Q2.
Which of these class can generate an array which can increase and decrease in size automatically?
Discuss
Answer: (a).ArrayList()
Q3.
Which of these method can be used to increase the capacity of ArrayList object manually?
Discuss
Answer: (d).ensureCapacity()
Q4.
Which of these method of ArrayList class is used to obtain present size of an object?
Discuss
Answer: (a).size()
Q5.
Which of these methods can be used to obtain a static array from an ArrayList object?
Discuss
Answer: (c).toArray()
Q6.
Which of these method is used to reduce the capacity of an ArrayList object?
Discuss
Answer: (d).trimToSize()
Q7.
What is the output of this program?
    import java.util.*;
    class Arraylist 
    {
        public static void main(String args[]) 
        {
            ArrayList obj = new ArrayList();
            obj.add("A");
            obj.add("B");
            obj.add("C");
            obj.add(1, "D");
            System.out.println(obj);
        }
    }
Discuss
Answer: (b).[A, D, B, C].
Q8.
What is the output of this program?
    import java.util.*;
    class Output 
    {
        public static void main(String args[]) 
        {
            ArrayList obj = new ArrayList();
            obj.add("A");
            obj.add(0, "B");
            System.out.println(obj.size());
        }
    }
Discuss
Answer: (c).2
Q9.
Map implements collection interface?
Discuss
Answer: (b).False
Q10.
Which of the below does not implement Map interface?
Discuss
Answer: (d).Vector

Suggested Topics

Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!