them 5.0 language additions

O

opalpa

Peeked at
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html, 5.0
javadoc for collections and it has stuff like:

binarySearch(List<? extends Comparable<? super T>> list, T key)

This used to be simple:

binarySearch(List list, Object key, Comparator c)

Generics have made code a bit simpler to write, my opinion anway.
However mkaing the javadoc look like C++ code is not to my liking.

<? looks like an html formating error, but I doubt it.
 
W

Wayne

Peeked at
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html, 5.0
javadoc for collections and it has stuff like:

binarySearch(List<? extends Comparable<? super T>> list, T key)

This used to be simple:

binarySearch(List list, Object key, Comparator c)

Generics have made code a bit simpler to write, my opinion anway.
However mkaing the javadoc look like C++ code is not to my liking.

<? looks like an html formating error, but I doubt it.

It's not a formatting error. There are several short, readable
intoductions to generics with the JDK documentation and elsewhere.
Please note you don't have to use 'em! The old way works fine.
The new way is better and usually leads to less (and more readable)
code, but it is one more thing you need to learn.

Try these links:

Overview of new J5 features:
http://java.sun.com/features/2003/05/bloch_qa.html
http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html

Generics:
http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf

Hope this helps!

-Wayne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top