|
INTERVIEW QUESTIONS
J2EE
JAVA
DETAILS
Question: Difference between Enumeration and Iterator
Answer: The Enumeration interface is what allows you to walk through the elements of a legacy collection(ie., for Synchronized Collections). Iterator interface is used for stepping through the elements(.ie., for ArrayList,LinkedList).
|
|
|
Category |
Java Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7148 users |
Added on |
7/14/2011 |
Views |
68650 |
Rate it! |
|
|
Question:
Difference between Enumeration and Iterator
Answer:
The Enumeration interface is what allows you to walk through the elements of a legacy collection(ie., for Synchronized Collections). Iterator interface is used for stepping through the elements(.ie., for ArrayList,LinkedList). Source: CoolInterview.com
Hi.. Enumeration and Iterator both are interfaces,hoth are used to accessing the data from the collection objects.But the difference is Enumeration does not having the "remove()" method, But Iterator having the "remove()" method. Enumeration is deprecated one. Source: CoolInterview.com
Answered by: DEVARATHNAM CHINNAKOTLA, S.V. University,Tirupati. | Date:
| Contact DEVARATHNAM CHINNAKOTLA, S.V. University,Tirupati.
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How do you release an object which is locked in a synchronized block
|
View Answer
|
|
Difference between HashMap and TreeMap
|
View Answer
|
|
How can a Variable in a class other than String type be made Immutable.
|
View Answer
|
|
Why we can't put semicolon at the end of a class in java??
|
View Answer
|
|
Why arraylist(and other classes) cantnot be synchronized
|
View Answer
|
|
Why main method should be declared as public and why in some versions it is mandatory and in some versions it is not mandatory??
|
View Answer
|
|
Plz give me detail difference between Tomcat & Weblogic server
|
View Answer
|
|
How you can add the 10 days in the current date in jsp?
|
View Answer
|
|
What is socket? and server socket?
|
View Answer
|
|
Why Concept Of Pointer is not there in java
|
View Answer
|
|
When does JIT plays its role. Does JIT come along with jdk? If so then what is role of interpreter?
|
View Answer
|
|
Will class level variables are garbage collected?
|
View Answer
|
|
What is difference between array list and vector.? and which one is most useful.? array list does whatever vector does so why we need the array list?
|
View Answer
|
|
Mention 5 basic difference between Array List and Vector in Java Colletion FrameWork.
|
View Answer
|
|
What is a "Java Client" ?
|
- Java Interview Questions & Answers">
View Answer
|
|
What is class variables and instance variables?
|
View Answer
|
|
What is components and controllers in Java
|
View Answer
|
|
What is the corresponding Layout for Card in Swing
|
View Answer
|
|
What is difference in between Java Class and Bean
|
View Answer
|
|
What is the exact difference in between Unicast and Multicast object ? Where we will use ?
|
View Answer
|