Results 1 to 13 of 13

Thread: What is Difference between List and ArrayList

  1. #1
    Junior Member
    Join Date
    Sep 2006
    Answers
    6

    What is Difference between List and ArrayList

    What is Difference between List and ArrayList.. Which condition to use List x= new ArrayList(); or ArrayList x= new ArrayList();


  2. #2
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    Re: What is Difference between List and ArrayList

    Go through the following URL..They analys these two topics with 64-bit machine and 32-bit machine..

    ArrayList’s vs. generic List for primitive types and 64-bits

    --------------------
    suresh


  3. #3
    Junior Member
    Join Date
    Jul 2007
    Answers
    12

    Re: What is Difference between List and ArrayList

    For the handling of objects collection in Java, Collection interface have been provided. This is avail in java.util package.

    "List" is an interface, extends collection interface, provides some sort of extra methods than collection interface to work with collections. Where as "ArrayList" is the actual implementation of "List" interface.

    The both code snippets provided by u were absolutely right, cause a reference of interface can point to implementaion class object.


  4. #4
    Junior Member
    Join Date
    Nov 2008
    Answers
    1

    Re: What is Difference between List and ArrayList

    thanks.............


  5. #5
    Junior Member
    Join Date
    Dec 2008
    Answers
    2

    Re: What is Difference between List and ArrayList

    List: List is an interface in collection framework. several classes like ArrayList, LinkedList implement this interface. List is an ordered collection , so the position of an object does matter.

    ArrayList: An ArrayList is a class which can grow at runtime. you can store java objects in an ArrayList and also add new objects at run time.
    you will use ArrayList when you dont have to add or remove objects frequently from it. Because when you remove an object, all other objects need to be repositioned inside the ArrayList, if you have this kind of situation, try using LinkedList instaed.


  6. #6
    Junior Member
    Join Date
    Dec 2008
    Answers
    2

    Re: What is Difference between List and ArrayList

    List is interface in java.util package which extends Collection interface.
    This are part of CollectionFramework .Collection is the root interface . This framework gives us a sophisticated way to group different types of objects.List interface can accept duplicate elements or objects and we can access them with respect to indexes. ArrayList is a class which implements List interface.
    Both syntax are correct 1.a variable of type interface can point to its implementation class object.


  7. #7
    Junior Member
    Join Date
    Dec 2008
    Answers
    2

    Re: What is Difference between List and ArrayList

    In oracle can we store NULL values?


  8. #8
    Junior Member
    Join Date
    Dec 2008
    Answers
    2

    Re: What is Difference between List and ArrayList

    In oracle can we store NULL values in primary key feild?


  9. #9
    Junior Member
    Join Date
    May 2007
    Answers
    7

    Re: What is Difference between List and ArrayList

    what is the rules for primary key?
    it wont accept null and duplication
    isn't
    then how we can store NULL in primary key field


  10. #10
    Junior Member
    Join Date
    Jan 2009
    Answers
    1

    Re: What is Difference between List and ArrayList

    what is difference between string and stringbuffer?


  11. #11
    Junior Member
    Join Date
    May 2007
    Answers
    7

    Re: What is Difference between List and ArrayList

    string is immutable - it stores contants
    stringbuffer is mutable - you manipulate string add, delete, insert


  12. #12
    Junior Member
    Join Date
    Sep 2009
    Answers
    2

    Re: What is Difference between List and ArrayList

    A List is a control that displays a scrollable List of Items.Arrat List is collection of all elements of the same tipe that are refrenced by a common name.Each element in an array can be referd to by an arrayname and a suscript or index.


  13. #13
    Junior Member
    Join Date
    Sep 2009
    Answers
    2

    Re: What is Difference between List and ArrayList

    we cant store null valu in primery key


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact