Thomas Sundberg

May 22, 2011

A Generics example

Filed under: Java, Teaching — Tags: , , , , , , , — Thomas Sundberg @ 22:15

Generics has been a a part of Java since Java 5. It will allow you to write code that handles types without deciding which type upfront. This is of course very useful for collections. It used to be done using the inheritance system and casting Object to the type you knew should be used.

(more…)

Theme: Customized Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 41 other followers