This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Interface/Implemented class reference " Watch "Interface/Implemented class reference " New topic

Interface/Implemented class reference

UdayK Kumar

Joined: Aug 05, 2009
Posts: 26


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

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

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: 449

Search for 'programming to an interface'.
I agree. Here's the link:
subject: Interface/Implemented class reference
jQuery in Action, 3rd edition