What is Difference between List and ArrayList.. Which condition to use List x= new ArrayList(); or ArrayList x= new ArrayList();
Printable View
What is Difference between List and ArrayList.. Which condition to use List x= new ArrayList(); or ArrayList x= new ArrayList();
Go through the following URL..They analys these two topics with 64-bit machine and 32-bit machine..
[URL="http://blogs.msdn.com/joshwil/archive/2004/04/13/112598.aspx"]ArrayList’s vs. generic List for primitive types and 64-bits[/URL]
--------------------
suresh
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.
thanks.............
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.
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.
In oracle can we store NULL values?
In oracle can we store NULL values in primary key feild?
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
what is difference between string and stringbuffer?
string is immutable - it stores contants
stringbuffer is mutable - you manipulate string add, delete, insert
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.
we cant store null valu in primery key