Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

What is Difference between List and ArrayList

This is a discussion on What is Difference between List and ArrayList within the Java forums, part of the Software Development category; What is Difference between List and ArrayList.. Which condition to use List x= new ArrayList(); or ArrayList x= new ArrayList();...

Go Back   Geeks Talk > Software Development > Java
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

Java Java related Issues and Problems

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-19-2007
Junior Member
 
Join Date: Sep 2006
Location: India
Posts: 6
Thanks: 0
Thanked 2 Times in 1 Post
ksamir2004 is on a distinguished road
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();
Reply With Quote
The Following 2 Users Say Thank You to ksamir2004 For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 07-20-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,016
Thanks: 0
Thanked 91 Times in 72 Posts
psuresh1982 will become famous soon enough
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
Reply With Quote
  #3 (permalink)  
Old 07-23-2007
Junior Member
 
Join Date: Jul 2007
Location: Bangalore, India
Posts: 12
Thanks: 0
Thanked 3 Times in 2 Posts
JaiBharath is on a distinguished road
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.
Reply With Quote
  #4 (permalink)  
Old 11-24-2008
Junior Member
 
Join Date: Nov 2008
Location: banglore,karnataka,india
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
anganav is on a distinguished road
Re: What is Difference between List and ArrayList

thanks.............
Reply With Quote
  #5 (permalink)  
Old 12-17-2008
Junior Member
 
Join Date: Dec 2008
Location: Bangalore
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
from_sand is on a distinguished road
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.
Reply With Quote
  #6 (permalink)  
Old 12-28-2008
Junior Member
 
Join Date: Dec 2008
Location: india
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
orbit.pnk is on a distinguished road
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.
Reply With Quote
  #7 (permalink)  
Old 12-28-2008
Junior Member
 
Join Date: Dec 2008
Location: India
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Ketanmeena is on a distinguished road
Re: What is Difference between List and ArrayList

In oracle can we store NULL values?
Reply With Quote
  #8 (permalink)  
Old 12-28-2008
Junior Member
 
Join Date: Dec 2008
Location: India
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Ketanmeena is on a distinguished road
Re: What is Difference between List and ArrayList

In oracle can we store NULL values in primary key feild?
Reply With Quote
  #9 (permalink)  
Old 01-05-2009
Junior Member
 
Join Date: May 2007
Location: Coimbatore
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Akilan Paul is on a distinguished road
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
Reply With Quote
  #10 (permalink)  
Old 01-06-2009
Junior Member
 
Join Date: Jan 2009
Location: bangalore
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
somashekar.R is on a distinguished road
Re: What is Difference between List and ArrayList

what is difference between string and stringbuffer?
Reply With Quote
  #11 (permalink)  
Old 01-06-2009
Junior Member
 
Join Date: May 2007
Location: Coimbatore
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Akilan Paul is on a distinguished road
Re: What is Difference between List and ArrayList

string is immutable - it stores contants
stringbuffer is mutable - you manipulate string add, delete, insert
Reply With Quote
  #12 (permalink)  
Old 09-21-2009
Junior Member
 
Join Date: Sep 2009
Location: india
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
rishi_niit is on a distinguished road
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.
Reply With Quote
  #13 (permalink)  
Old 09-21-2009
Junior Member
 
Join Date: Sep 2009
Location: india
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
rishi_niit is on a distinguished road
Re: What is Difference between List and ArrayList

we cant store null valu in primery key
Reply With Quote
Reply

  Geeks Talk > Software Development > Java

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
An ArrayList and a Vector FantaGuy Java 5 03-19-2009 12:34 PM
Execute two detail list from a basic list at same time Geek_Guest SAP R/3 0 06-26-2007 07:34 AM
Why we say arraylist is not synchronized where as vector are Geek_Guest Java 1 06-20-2007 12:50 PM
Can we use the list view control in ASP.Net 2.0 Geek_Guest ASP.NET 1 06-13-2007 10:16 AM
Create arraylist dynamically Geek_Guest C# 1 04-15-2007 12:23 PM


All times are GMT -4. The time now is 06:33 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved