Set hs = new HashSet();
here, u create set interface reference and point it HashSet class and
this reference has knowledge about the fields of the set interface and
not of HashSet class.

HashSet hs = new HashSet();
here, we are creating a HashSet object, which implements set inteface
and its class members.

think this will help....

On Sep 30, 7:02 am, fkcoble <[email protected]> wrote:
> I have a question.
>
> What's the difference between:
>
> Set hs = new HashSet();
>
> and
>
> HashSet hs = new HashSet();
>
> ?

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to