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

Q81.
Which of these package is used for all the text related modifications?
Discuss
Answer: (a).java.text
Q82.
What is the output of this program?
    import java.lang.reflect.*;
    class Additional_packages 
    {  
         public static void main(String args[]) 
         {
      try 
             {
          Class c = Class.forName("java.awt.Dimension");
   Constructor constructors[] = c.getConstructors();
   for (int i = 0; i < constructors.length; i++)
       System.out.println(constructors[i]);
      }
      catch (Exception e)
             {
             System.out.print("Exception");
             }
        }
    }
Discuss
Answer: (a).Program prints all the constructors of ‘java.awt.Dimension’ package
Q83.
What is the output of this program?
    import java.lang.reflect.*;
    class Additional_packages 
    {  
         public static void main(String args[])
         {
      try 
             {
          Class c = Class.forName("java.awt.Dimension");
   Field fields[] = c.getFields();
   for (int i = 0; i < fields.length; i++)
       System.out.println(fields[i]);
      }
      catch (Exception e)
             {
             System.out.print("Exception");
             }
        }    
    }
Discuss
Answer: (c).Program prints all the data members of ‘java.awt.Dimension’ package
Q84.
Which of these return type of hasNext() method of an iterator?
Discuss
Answer: (c).Boolean
Q85.
Which of these methods is used to obtain an iterator to the start of collection?
Discuss
Answer: (d).iterator()
Q86.
Which of these methods can be used to move to next element in a collection?
Discuss
Answer: (a).next()
Q87.
Which of these iterators can be used only with List?
Discuss
Answer: (b).ListIterator
Q88.
Which of these is a method of ListIterator used to obtain index of previous element?
Discuss
Answer: (b).previousIndex()
Q89.
Which of these exceptions is thrown by remover() method?
Discuss
Answer: (d).IllegalStateException
Q90.
What is the output of this program?
    import java.util.*;
    class Collection_iterators 
    {
        public static void main(String args[]) 
        {
            ListIterator a = list.listIterator();
                if(a.previousIndex()! = -1)
                    while(a.hasNext())
                 System.out.print(a.next() + " ");
                else
                   System.out.print("EMPTY");
        }
    }
Discuss
Answer: (d).EMPTY

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!