ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
What is the difference between set and list?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between set and list?
Answer
# 1
set stores elements in an unordered way but does not 
contain duplicate elements,where as ist stores elements in 
an ordered way but may contain duplicate elements.
 
Is This Answer Correct ?    24 Yes 1 No
Janet
 
  Re: What is the difference between set and list?
Answer
# 2
set-->
when uniqueness is required you need to implement set.
e.g.
HashSet(unOrd,unSort) Fast access, assures no duplicates,
provides no ordering.
LinkedHashSet(Ord,unSort)No duplicates; iterates by
insertion order.
TreeSet(ascending,naturalord)No duplicates ; iterates in
sorted order.

list-->
when ordered list is required you need to implement list.
e.g.
ArrayList(Ord,unSort)Fast iteration and fast random access.
Vector(syncronized)
LinkedList()Good for adding elements to the ends, i.e.,
stacks and queues.
 
Is This Answer Correct ?    16 Yes 1 No
Sumit
 
 
 
  Re: What is the difference between set and list?
Answer
# 3
set stores elements in an unordered way but does not 
contain duplicate elements,where as it stores elements in 
an ordered way but may contain duplicate elements.
 
Is This Answer Correct ?    0 Yes 0 No
May
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What are the allowed, non-Unicode letter characters that can be used as the first character of an identifier?  2
how to handled exceptions & erros in ejb? Satyam1
What is Applet Flickering ? Persistent1
when to use abstract class and when to use interface? IonIdea5
How does Vector implement synchronization? Ness-Technologies2
what is difference between excute query ()and execute update ()? Symphony5
How many methods does cloneable interface contains?  2
what release of java technology are currently available what do they contain?  1
Explain about global variables in Java?  2
How can you reverse a string?  4
what is the form of storage space in java?  5
Different types of modifiers? RoboCom3
what is private constructor?what are the uses of writing private constructor in our program?  5
Explain Event handling in AWT? TCS1
primitive data types in Java ?  3
what is meaning of JIT?  4
Explain, why the constructor is required in implemented class?  2
What is the protocol is used in type4 driver? CMC2
What is the default modifier in Interface?  4
what is unreachable code problem in multiple catch statements  2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com