• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Any need to use generics if using java 1.5

 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing my assignment in java 1.5, for the features it provides, and also because I am not getting time to work on the assignment, so I could slip.

Any need to use generics if using java 1.5.
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No it's not mandatory. You will get a compile-time warning if you use a Collection but don't specify what's in the Collection. But you can still compile.
 
Lara McCarver
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would recommend using Generics if you are using 1.5. Yes, it is a little more work(if you are currently not using Generics), but it is also a way of letting the compiler catch your bugs for you
[ March 02, 2006: Message edited by: Lara McCarver ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic