R4R
Right Place For Right Person TM
 

R4R Java Packages Util Subjective Question

 


Warning: include(../../common-files/ads1.shtml) [function.include]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\r4r.co.in\httpdocs\common-files\php\interviewQuestionsAndAnswers.php on line 471

Warning: include(../../common-files/ads1.shtml) [function.include]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\r4r.co.in\httpdocs\common-files\php\interviewQuestionsAndAnswers.php on line 471

Warning: include() [function.include]: Failed opening '../../common-files/ads1.shtml' for inclusion (include_path='.;./includes;./pear') in C:\Inetpub\vhosts\r4r.co.in\httpdocs\common-files\php\interviewQuestionsAndAnswers.php on line 471

Tolal:21 Click: 1 2
Warning: include(../../common-files/ads2.shtml) [function.include]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\r4r.co.in\httpdocs\common-files\php\interviewQuestionsAndAnswers.php on line 764

Warning: include(../../common-files/ads2.shtml) [function.include]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\r4r.co.in\httpdocs\common-files\php\interviewQuestionsAndAnswers.php on line 764

Warning: include() [function.include]: Failed opening '../../common-files/ads2.shtml' for inclusion (include_path='.;./includes;./pear') in C:\Inetpub\vhosts\r4r.co.in\httpdocs\common-files\php\interviewQuestionsAndAnswers.php on line 764

Previous Home Next

Util Interview Questions And Answers

Page 1

Ques: 1 what is Util
Ques: 2 Explain Set Interface?

Ans:
The List interface provides support for ordered collections of objects.

Ans:
The Vector class provides the capability to implement a growable array of objects.

Ans:
In mathematical concept, a set is just a group of unique items, in the sense that the group contains no duplicates. The Set interface extends the Collection interface. Set does not allow duplicates in the collection. In Set implementations null is valid entry, but allowed only once.

Ques: 3 What is the Collections API?

Ans:
The Collections API is a set of classes and interfaces that support operations on collections of objects.

Ques: 4 What is the difference between Enumeration and Iterator interface?

Ans:
The Enumeration interface allows you to iterate through all the elements of a collection. Iterating through an Enumeration is similar to iterating through an Iterator. However, there is no removal support with Enumeration.

Ques: 5 Explain Enumeration Interface?

Ans:
The Enumeration interface allows you to iterate through all the elements of a collection. Iterating through an Enumeration is similar to iterating through an Iterator. However, there is no removal support with Enumeration. Basic methods: boolean hasMoreElements(); Object nextElement();

Ques: 6 What is an Iterator interface?

Ans:
The Iterator interface is used to step through the elements of a Collection .

Ques: 7 
Explain Java Collections Framework?

Ans:
Java Collections Framework provides a well designed set of interfaces and classes that support operations on a collection of objects.

Ques: 8 Explain Iterator Interface and main method of Iterator?

Ans:
An Iterator is similar to the Enumeration interface. With the Iterator interface methods, you can traverse a collection from start to end and safely remove elements from the underlying collection. The iterator() method generally used in query operations. Basic methods: iterator.remove(); iterator.hasNext(); iterator.next();

Ques: 9 What are the two types of Set implementations available in the Collections Framework?

Ans:
HashSet and TreeSet are the two Set implementations available in the Collections Framework.

Ques: 10 
What is the difference between HashSet and TreeSet?

Ans:
HashSet Class implements java.util.Set interface to eliminate the duplicate entries and uses hashing for storage. Hashing is nothing but mapping between a key value and a data item, this provides efficient searching. The TreeSet Class implements java.util.Set interface provides an ordered set, eliminates duplicate entries and uses tree for storage.

Ques: 11 
What is the difference between ArrayList and LinkedList?

Ans:
The ArrayList Class implements java.util.List interface and uses array for storage. An array storage’s are generally faster but we cannot insert and delete entries in middle of the list. To achieve this kind of addition and deletion requires a new array constructed. You can access any element at randomly. The LinkedList Class implements java.util.List interface and uses linked list for storage. A linked list allow elements to be added, removed from the collection at any location in the container by ordering the elements. With this implementation you can only access the elements in sequentially.

Ques: 12 Explain Map Interface?

Ans:
A map is a special kind of set with no duplicates. The key values are used to lookup, or index the stored data. The Map interface is not an extension of Collection interface, it has it’s own hierarchy. Map does not allow duplicates in the collection. In Map implementations null is valid entry, but allowed only once.

Ques: 13 
What are the two types of Map implementations available in the Collections Framework?

Ans:
HashMap and TreeMap are two types of Map implementations available in the Collections Framework.

Ques: 14 
What is the difference between HashMap and TreeMap?

Ans:
The HashMap Class implements java.util.Map interface and uses hashing for storage. Indirectly Map uses Set functionality so, it does not permit duplicates. The TreeMap Class implements java.util.Map interface and uses tree for storage. It provides the ordered map.

Ques: 15 
Explain the functionality of Vector Class?

Ans:
Once array size is set you cannot change size of the array. To deal with this kind of situations we use Vector. Vector grows and shrink it’s size automatically. Vector allows to store only objects not primitives. To store primitives, convert primitives in to objects using wrapper classes before adding them into Vector. The Vector reallocates and resizes itself automatically.

Ques: 16 
What does the following statement convey?

Ans:
Vector vt = new Vector(3, 10); vt is an instance of Vector class with an initial capacity of 3 and grows in increment of 10 in each relocation

Ques: 17 
What is the difference between Vector and ArrayList?

Ans:
Vector and ArrayList are very similar. Both of them represent a growable array. The main difference is that Vector is synchronized while ArrayList is not.

Ques: 18 
What is the difference between Hashtable and HashMap?

Ans:
Both provide key-value access to data. The key differences are : a. Hashtable is synchronised but HasMap is not synchronised. b. HashMap permits null values but Hashtable doesn’t allow null values. c. iterator in the HashMap is fail-safe while the enumerator for the Hashtable is not fail safe.

Ques: 19 
How do I make an array larger?

Ans:
You cannot directly make an array larger. You must make a new (larger) array and copy the original elements into it, usually with System.arraycopy(). If you find yourself frequently doing this, the Vector class does this automatically for you, as long as your arrays are not of primitive data types.

Ques: 20 
What is the use of Locale class?

Ans:
The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region


Goto Page:

Warning: include(../../common-files/ads2.shtml) [function.include]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\r4r.co.in\httpdocs\common-files\php\interviewQuestionsAndAnswers.php on line 813

Warning: include(../../common-files/ads2.shtml) [function.include]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\r4r.co.in\httpdocs\common-files\php\interviewQuestionsAndAnswers.php on line 813

Warning: include() [function.include]: Failed opening '../../common-files/ads2.shtml' for inclusion (include_path='.;./includes;./pear') in C:\Inetpub\vhosts\r4r.co.in\httpdocs\common-files\php\interviewQuestionsAndAnswers.php on line 813

1 2
Share |

Util Objective

Util Objective Questions And Answers

Util Interview Questions And Answers

Util Interview Questions And Answers

R4R,Util Objective, Util Subjective, Util Interview Questions And Answers,Util,Util Interview,Util Questions ,Util Answers

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R