W
waiter.james1991
public <E> String FUNCTIONNAME( ?,?) {
......
}
it's return type is <E>String ???
what it's exactly mean?
......
}
it's return type is <E>String ???
what it's exactly mean?
public <E> String FUNCTIONNAME( ?,?) {
......
}
it's return type is <E>String ???
No. The return type would be String.public<E> String FUNCTIONNAME( ?,?) {
......
}
it's return type is<E>String ???
See:what it's exactly mean?
No. The return type would be String.
The <E>, a "type parameter", simply introduces a name
for a generic type into the scope of the method.
You have apparently chosen to ignore it in your paraphrased example.
what it's [sic] exactly mean?
See:
<http://docs.oracle.com/javase/tutorial/extra/generics/methods.html>
and/or a generic web search using the terms java+generic+method.
No.
Got enough question marks there?
See
http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.4
"MethodHeader:
" MethodModifiers[opt] TypeParameters[opt] Result MethodDeclarator Throws[opt]"
http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.4.4
"A method is /generic/ if it declares one or more type variables (§4.4).
"These type variables are known as the type parameters of the method. The form of the type parameter section of a generic method is identical to the type parameter section of a generic class (§8.1.2)."
etc.
No. The return type would be String.
The<E>, a "type parameter", simply introduces a name
for a generic type into the scope of the method.
You have apparently chosen to ignore it in your paraphrased example.
what it's [sic] exactly mean?
See:
<http://docs.oracle.com/javase/tutorial/extra/generics/methods.html>
and/or a generic web search using the terms java+generic+method.
public <E> String FUNCTIONNAME( ?,?) {
......
}
it's return type is <E>String ???
what it's exactly mean?
public <E> String FUNCTIONNAME( ?,?) {
......
}
it's return type is <E>String ???
what it's exactly mean?
RTFM.
Since the manuals index will not have a snippet like the
quoted code, then it will be reading from first page to
last page for those not knowing that the keyword is "generics".
Jeff said:It's curious that you reply to my reply to the original post
and then leave my comments uncommented upon. It seems somewhat
akin to top posting. I admit to having committed the same
on occasion, but you do it with some regularity and I thought
to comment on this occasion. Perhaps your newsreader makes it
difficult to negotiate the hierarchy of the thread and you
simply reply to the last post read.
this is a broken
line through the
f- friendly interface.
I insert my comments inline where I have further remarks, but I keep
yours where they were, as with other cited material, to establish context
and to endorse the content, as useful at least and, in your case, as correct.
If I put my remarks under yours, then it looks as though I'm reacting to that
remark, when my point is usually marginal to an earlier line by a different
poster.
If I remove your remarks, then I lose the context that I deem important to cite.
I often find myself responding to threads where the main question has already
been answered better than I could have, but I see dangling threads. For example,
this is hypothetical, say I see an idiom for a 'final' instance method in a concurrent
context, and I see that 'final' might server better. I'll comment on that, and leave
your remarks in place in order not to lose the real answer.
And I'm using a web interface to Usenet which is a pain in the ass. It breaks lines
arbitrarily and doubles the lines, so a quoted line is
I have to demangle a lot to post. It's a testament to how important I think my
comments are that I am willing to go through all this effort to share them.
You're welcome.
(That was a joke, BTW.)
For various reasons unrelated to product quality it's inconvenient to use
Thunderbird lately. I find the discussions here very enlightening so I soldier on.
If that sounds angry, it really is not.Ah, OK an unannounced inline addendum. Thanks for the explanation.
While replying to the original post I briefly considered tracking down
and including links to the relevant parts of the JLS but thought that
would muddy my attempt at a simple lay explanation.
You gasp and sputter, I heard you.
Anyway you whip out the BNF in all its glorious Truth and Beauty, and it
is Majestic. I thank you. No joke. I'm sure the newb is feelin' it too.
Yes, I do miss his rambunctious nature andYep, it's sad. I recall Andrew Thompson experiencing a similar
predicament (forced use of a WITUN) shortly before he pissed off
of c.l.j.p to focus his attention on the greater volume an perhaps
more stimulating Q/A type discussion at the (then) Sun Java Forums.
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.