-
Junior Member
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();
-
Contributing Member
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
-
Junior Member
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.
-
Junior Member
Re: What is Difference between List and ArrayList
-
Junior Member
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.
-
Junior Member
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.
-
Junior Member
Re: What is Difference between List and ArrayList
In oracle can we store NULL values?
-
Junior Member
Re: What is Difference between List and ArrayList
In oracle can we store NULL values in primary key feild?
-
Junior Member
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
-
Junior Member
Re: What is Difference between List and ArrayList
we cant store null valu in primery key
-
Junior Member
Re: What is Difference between List and ArrayList
what is difference between string and stringbuffer?
-
Junior Member
Re: What is Difference between List and ArrayList
string is immutable - it stores contants
stringbuffer is mutable - you manipulate string add, delete, insert
-
Junior Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules