Friday, February 6, 2015

Seasoned Java programmers are programming to interfaces. What does that mean?

You can read the first example as follows: “I want to declare a variable customers that will have all access to all API offered by the class ArrayList“. The second version means the following: “I want to declare a variablecustomers that has a behavior declared in the List interface”. The first example declares a variable of a specific implementation of the List interface – ArrayList. Now take a look at this code example:



from dzone.com: latest front page http://www.dzone.com/links/r/seasoned_java_programmers_are_programming_to_inte.html

No comments:

Post a Comment