Downloaded generic 2.0 .
Yup, I'm quite new to generics, but it definitly lets me use all the additions, unlike the old compiler.
But I have two questions , and I think this may be as good a place to ask as any other-
1. Is there an API documnetation for tiger ?
2. why doesn't this work ? -
Hmm..am not really sure what "autoboxing" means ..are you referring to auto upcasting or something ?
Well you would need to caste it (coz hashmap would store it as an object and not as a double..I mean the particular class information is lost).Hence when you are retrieving , you need to cast it properly or you declare the return type as Object.
And also when you are returning -1.00 , compiler will complain , coz it doesnt expect a primitive...but an object.
Hmm..am not really sure what "autoboxing" means ..are you referring to auto upcasting or something ?
Well you would need to cast it (coz hashmap would store it as an object and not as a double..I mean the particular class information is lost).Hence when you are retrieving , you need to cast it properly or you declare the return type as Object.
And also when you are returning -1.00 , compiler will complain , coz it doesnt expect a primitive...but an object.
Re: generics 2.0 : A bug ,or I am doing something wrong ?
Jun 11, 2003 5:06 AM
(reply 3
of 11) (In reply to
#2 )
we6junkie, with all due respect, you don't seem competent to answer questions in this particular forum. Read the documentation on generics and autoboxing - there are links one or two of the six or so most recent threads.
I do think you're expecting too much from autoboxing. I believe its only specified to work in certain places. Then again: why is that? It'll only serve to confuse people. I don't see why
Hi ,
Thanks all , specially The Lord.
Yeah , I went through almost whole of the forums and tried to put the bits togather . Not everything goes well with the compiler yet.
To start with , it seems auto-Unboxing doesn't work yet .So I better forget
abt. a few things.
However, I'd like to know this -
Is return -1.00d not a case of autoboxing , and only Map.put("Three",3) is ?
Also, I'm still looking for something like an API for generics .
PS- Sorry for my late response.It's partly due to the time-lag.
Thanks again.
Re: generics 2.0 : A bug ,or I am doing something wrong ?
Jun 14, 2003 2:00 PM
(reply 10
of 11) (In reply to
#9 )
Incidentally, although Sun doesn't have a generics-compatible javadoc, SinjDoc does exist and is exactly such a thing. So you can generate the API docs yourself. SinjDoc doesn't yet support the new variance syntax or the JSR-201 features, but it will shortly. See http://cag.lcs.mit.edu/~cananian/Projects/GJ/