top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are the advantages of using Interface type in collection ?

+1 vote
111 views
What are the advantages of using Interface type in collection ?
posted Jan 7, 2015 by Roshni

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Advantage s of using interface collection

(1)We can switch the implementation without changing the code.

(2)It is easy to test our code with testing and mocking frameworks.

(3)We can use the most generalized interface for data exchange (enumerator instead of a list, if you only want to iterate over the values).

answer Jan 8, 2015 by Karthick.c
...