Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes basic question about ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "basic question about ArrayList" Watch "basic question about ArrayList" New topic
Author

basic question about ArrayList

naweed kth
Greenhorn

Joined: Dec 29, 2010
Posts: 1
why we instantiate ArrayList polymorphically.
List list = new ArrayList();
what is the disadvantage of
Arraylist list = new ArrayList();

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

to avoid to tieup with a specific implementation of List.

by the way, this discussion happened in javaranch many time. search here...
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Welcome to JavaRanch
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: basic question about ArrayList
 
Similar Threads
comparison of List & ArrayList
size of the list
Object Creation
collection
Collections.copy method for lists ? how it works