aspose file tools*
The moose likes Beginning Java and the fly likes what is this line mean: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is this line mean:" Watch "what is this line mean:" New topic
Author

what is this line mean:

Tal Goldstein
Greenhorn

Joined: Apr 16, 2006
Posts: 14
public class DelayQueue<E extends Delayed>

what the <> does?
and where can i read about it?

thanks
Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
Hi,

Check this.

Best of luck ...


Vassili ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
David Irwin
Ranch Hand

Joined: Mar 25, 2004
Posts: 82
As Vassili pointed out, the <> are used in Generics, a language addition in Java version 1.5. It essentially allows the developer to create type declarations. I have found this especially helpful in the Collections framework. For example before 1.5 you might do something like the following:



Notice that I have to cast the return object from an Object to an Item. In Java 1.5 and later you can declare a list of a specific type:



See how you don't need to cast from an Object to an Item. And it also prevents non-Item type objects from being added to the list. Type safety is generally increased.

You might also check out the following tutorial: tutorial.

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is this line mean:
 
Similar Threads
html:messages does not display messages
following::* doubt
Dynamically Scrolling to the newly added row in HTML table.
HTML Tags in XML file
Case in DTD