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 5 of 18

Q41.
Which of these method is used to add an element to the start of a LinkedList object?
Discuss
Answer: (d).addFirst()
Q42.
Which of these method of HashSet class is used to add elements to its object?
Discuss
Answer: (a).add()
Q43.
Which of these methods can be used to delete the last element in a LinkedList object?
Discuss
Answer: (c).removeLast()
Q44.
Which of this method is used to change an element in a LinkedList Object?
Discuss
Answer: (b).set()
Q45.
What is the output of this program?
    import java.util.*;
    class Linkedlist 
    {
        public static void main(String args[]) 
        {
            LinkedList obj = new LinkedList();
            obj.add("A");
            obj.add("B");
            obj.add("C");
            obj.addFirst("D");
            System.out.println(obj);
        }
    }
Discuss
Answer: (d).[D, A, B, C].
Q46.
What is the output of this program?
    import java.util.*;
    class Linkedlist 
    {
        public static void main(String args[]) 
        {
            LinkedList obj = new LinkedList();
            obj.add("A");
            obj.add("B");
            obj.add("C");
            obj.removeFirst();
            System.out.println(obj);
        }
    }
Discuss
Answer: (b).[B, C].
Q47.
Which of these object stores association between keys and values?
Discuss
Answer: (b).Map
Q48.
Which of these classes provide implementation of map interface?
Discuss
Answer: (b).HashMap
Q49.
Which of these method is used to remove all keys/values pair from the invoking map?
Discuss
Answer: (b).remove()
Q50.
Which of these method Map class is used to obtain an element in the map having specified key?
Discuss
Answer: (b).get()
Page 5 of 18

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!