The only difference is that you are holding on to a reference of the interface versus the class. The class implements more functionality than the interface but you can also cast the interface reference to the class and still call any method. As far as efficiency there is no difference. Both lines are instantiating a UserService .
Reputation Points: 1749
Solved Threads: 735
Senior Poster
Offline 3,948 posts
since Feb 2009