This post originated from an RSS feed registered with Java Buzz
by Angsuman Chakraborty.
Original Post: JDK1.5 - Painful bugs which bite...
Feed Title: Simple Thoughts on Java
Feed URL: http://sedoparking.com/search/registrar.php?domain=®istrar=sedopark
Feed Description: News and views as a Software Architect and Entepreneur on Java and related Technologies.
I wanted to create a simple max function, something I wanted to do for quite sometime, which takes a variable number of Number & Comparable arguments, essetially Integer, Double etc., and returns the max of the same type. Also I would like to use auto-boxing to enable me to pass int & floats. With generics, varargs, auto-boxing available, I thought I was all set until I tried. I realized the dream is there but JDK 1.5 is still far from realizing the vision.
The code shows an implementation which should, but doesn't compile with jdk1.5.
To compile use javac ...