This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Interface/Implemented class reference Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Interface/Implemented class reference " Watch "Interface/Implemented class reference " New topic
Author

Interface/Implemented class reference

UdayK Kumar
Greenhorn

Joined: Aug 05, 2009
Posts: 26

Hi,

Could you please elaborate in depth for the below code with suitable example?

#1)
List l = new ArrayList(); // Why GOOD.

#2)
ArrayList l = new ArrayList(); // Why BAD.


I saw many of explanation for the above code, but i didn't find any example for supporting #1) code.

Please explain me in depth...


Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 341
Search for 'programming to an interface'.


http://muhammadkhojaye.blogspot.com/
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Interface/Implemented class reference
 
Similar Threads
Object Creation
Why in collection Objects are assigned to super reference
Generics
Vector and Array LIst
error please help