Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

Collections VS Set In Declaring

Tue Oct 21, 2008 5:09 pm

Here a code :
Difference between the following 2 declarations
Code:
  Collection<String> s= new TreeSet<String>()

  Set <String> s = new TreeSet<String>()


It's just that the 2nd s can be referred to as a Set<String> whereas the
1st s cannot without casting.



Post a reply
  Related Posts  to : Collections VS Set In Declaring
 Collections API     -  
 Declaring a Simple Function     -  
 declaring variables problem     -  

Topic Tags

Java Collections