Question
import java.util.*;
class vector
{
public static void main(String args[])
{
Vector obj = new Vector(4,2);
obj.addElement(new Integer(3));
obj.addElement(new Integer(2));
obj.addElement(new Integer(5));
System.out.println(obj.capacity());
}
}
a.
2
b.
3
c.
4
d.
6
Posted under Java Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. Which of these class object uses the key to store value?
View solution
Q. Which of these method is used to insert value and its key?
View solution
Q. Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes?
View solution
Q. Which of these is a class which uses String as a key to store the value in object?
View solution
Q. Which of these methods is used to retrieve the elements in properties object at specific location?
View solution
Q. Which of these class object has an architecture similar to that of array?
View solution
Q. Which of these method is used to make a bit zero specified by the index?
View solution
Q. Which of these method is used to calculate number of bits required to hold the BitSet object?
View solution
Q. Which of these is a method of class Date which is used to search whether object contains a date before the specified date?
View solution
Q. Which of these methods is used to retrieve elements in BitSet object at specific location?
View solution
Q. What is Remote method invocation (RMI)?
View solution
Q. Which of these package is used for remote method invocation?
View solution
Q. Which of these methods are member of Remote class?
View solution
Q. Which of these Exceptions is thrown by remote method?
View solution
Q. Which of these class is used for creating a client for a server-client operations?
View solution
Q. Which of these package is used for all the text related modifications?
View solution
Q. Which of these return type of hasNext() method of an iterator?
View solution
Q. Which of these methods is used to obtain an iterator to the start of collection?
View solution
Q. Which of these methods can be used to move to next element in a collection?
View solution
Q. Which of these iterators can be used only with List?
View solution
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!