Comment
Above in this comment thread:
Red5: HOWTO create new applications
Double
Works for me
Posted by
magog
at
2006-07-09 14:28:27
Could you please provide the error you get? Using "Double" as described in the example works fine for me (Java 1.5.0_07 Eclipse 3.1.2, Windows XP).
Joachim
|
Correct your Eclipse configuration
Posted by
Anonymous User
at
2007-04-23 16:12:51
The Eclipse installation may default to Java 1.4 for its internal compilation. You can change this from Window > Preferences > Java > Compiler. The compiler compliance level should say 5.0 (at least, it shouldn't be higher than the version of your Java SDK or runtime environment installation).
This is necessary because the code snippet relies on a Java feature called 'autoboxing', which allows the implicit interchange of a primitive type (double) with its corresponding wrapper class (java.lang.Double). This actually has the compiler change the types of the parameters from Double to double before adding and change the type of the result back from double to Double before returning, without the programmer having to do so explicitly.
Hope this clears things up a little...
|