Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java 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)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

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 us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-13-2007, 12:00 PM
Senior Member
 
Join Date: Nov 2007
Posts: 115
ravian is on a distinguished road
List and ArrayList
Greetings,

I understand tat List is an interface and ArrayList is a class that implements the List interface. I am not able to understand the difference bwtween the following two statements:

Code:
List myArr = new ArrayList(); ArrayList myArr = new ArrayList();
Thanks in advance.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-13-2007, 09:21 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
The general idea of why the first line is recommended over the second is given on this page Lesson: Implementations in the fifth paragraph following the "General-purpose Implementations" table, starting with: "As a rule, you should be thinking about the interfaces, not the implementations.";
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-10-2007, 01:40 PM
Member
 
Join Date: Nov 2007
Posts: 12
javagk is on a distinguished road
Thanks for sharing this. Its helped me.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Project Trouble: Searching one ArrayList with another ArrayList BC2210 New To Java 2 04-21-2008 01:43 PM
ArrayList ramitmehra123 New To Java 1 02-07-2008 02:47 AM
ArrayList kizilbas1 New To Java 1 01-12-2008 10:48 PM
ArrayList kizilbas1 New To Java 11 12-05-2007 09:30 PM
Help ArrayList.add() eNine New To Java 2 08-06-2007 03:13 PM


All times are GMT +3. The time now is 11:20 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org