public <E> String FUNCTIONNAME( ?,?)

Discussion in 'Java' started by waiter.james1991@gmail.com, Oct 9, 2012.

  1. Guest

    public <E> String FUNCTIONNAME( ?,?) {

    ......
    }


    it's return type is <E>String ???
    what it's exactly mean?
     
    , Oct 9, 2012
    #1
    1. Advertising

  2. Roedy Green Guest

    On Tue, 9 Oct 2012 01:48:48 -0700 (PDT),
    wrote, quoted or indirectly quoted someone who said :

    >public <E> String FUNCTIONNAME( ?,?) {
    >
    > ......
    >}
    >
    >
    >it's return type is <E>String ???


    Method names are lower case

    The return type is String. To understand what the <E> means see
    http://mindprod.com/jgloss/generics.html
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    The iPhone 5 is a low end Rolex.
     
    Roedy Green, Oct 9, 2012
    #2
    1. Advertising

  3. Jeff Higgins Guest

    On 10/09/2012 04:48 AM, wrote:
    > public<E> String FUNCTIONNAME( ?,?) {
    >
    > ......
    > }
    >
    >
    > it's return type is<E>String ???

    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 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.
     
    Jeff Higgins, Oct 9, 2012
    #3
  4. Lew Guest

    Jeff Higgins wrote:
    > waiter.james1991@ wrote:
    >> public<E> String FUNCTIONNAME( ?,?) {
    >>
    >> ......
    >> }
    >>

    >
    >> it's return type is<E>String ???


    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.


    --
    Lew
     
    Lew, Oct 9, 2012
    #4
  5. Jeff Higgins Guest

    On 10/09/2012 01:15 PM, Lew wrote:
    > Jeff Higgins wrote:
    >> waiter.james1991@ wrote:
    >>> public<E> String FUNCTIONNAME( ?,?) {
    >>>
    >>> ......
    >>> }
    >>>

    >>
    >>> it's return type is<E>String ???

    >
    > 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.


    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.

    >
    >> 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.

    >
     
    Jeff Higgins, Oct 9, 2012
    #5
  6. Eric Sosman Guest

    On 10/9/2012 4:48 AM, wrote:
    > public <E> String FUNCTIONNAME( ?,?) {
    >
    > ......
    > }
    >
    >
    > it's return type is <E>String ???
    > what it's exactly mean?


    Perhaps I'm missing something (it happens), but I don't
    think it means anything at all. That is, I cannot think of
    a way to fill in the elided bits to arrive at compilable code.

    Could you show the actual code in which you found this,
    with enough surrounding context to give slow plodders like
    me a running start?

    --
    Eric Sosman
    d
     
    Eric Sosman, Oct 9, 2012
    #6
  7. On 09/10/2012 10:48, allegedly wrote:
    > public <E> String FUNCTIONNAME( ?,?) {
    >
    > ......
    > }
    >
    >
    > it's return type is <E>String ???
    > what it's exactly mean?


    RTFM.

    --
    DF.
     
    Daniele Futtorovic, Oct 9, 2012
    #7
  8. Arne Vajhøj Guest

    On 10/9/2012 5:47 PM, Daniele Futtorovic wrote:
    > On 09/10/2012 10:48, allegedly wrote:
    >> 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".

    Arne
     
    Arne Vajhøj, Oct 9, 2012
    #8
  9. On 10/10/2012 00:09, Arne Vajhøj allegedly wrote:
    > On 10/9/2012 5:47 PM, Daniele Futtorovic wrote:
    >> On 09/10/2012 10:48, allegedly wrote:
    >>> 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".


    It's a fair cop.

    <http://docs.oracle.com/javase/tutorial/java/generics/methods.html>

    --
    DF.
     
    Daniele Futtorovic, Oct 9, 2012
    #9
  10. Lew Guest

    Jeff Higgins wrote:
    > 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.


    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

    > this is a broken
    >
    > line through the
    >
    > f- friendly interface.


    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.

    --
    Lew
     
    Lew, Oct 10, 2012
    #10
  11. Jeff Higgins Guest

    [OT] The addendum and Meta [was]Re: public <E> String FUNCTIONNAME(?,?)

    On 10/09/2012 07:08 PM, Lew wrote:
    > Jeff Higgins wrote:
    >> 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.

    >
    > 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.


    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.

    >
    > 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
    >
    >> this is a broken
    >>
    >> line through the
    >>
    >> f- friendly interface.

    >
    > 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.
    >


    Yep, 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.
     
    Jeff Higgins, Oct 10, 2012
    #11
  12. Jeff Higgins Guest

    An addendum

    On 10/10/2012 05:51 AM, Jeff Higgins wrote:
    > On 10/09/2012 07:08 PM, Lew wrote:
    >> Jeff Higgins wrote:
    >>> 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.

    >>
    >> 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.

    >
    > 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.
    >

    If that sounds angry, it really is not.
    >>
    >> 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
    >>
    >>> this is a broken
    >>>
    >>> line through the
    >>>
    >>> f- friendly interface.

    >>
    >> 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.
    >>

    >
    > Yep, 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.
    >

    Yes, I do miss his rambunctious nature and
    wealth of sharable knowledge. Other parts no.
     
    Jeff Higgins, Oct 10, 2012
    #12
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    1
    Views:
    1,418
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    618
    SpamProof
    Oct 21, 2003
  3. Jake
    Replies:
    1
    Views:
    324
    mlimber
    Nov 11, 2005
  4. -Lost
    Replies:
    12
    Views:
    292
    Elegie
    Jan 31, 2007
  5. GTalbot
    Replies:
    3
    Views:
    112
    GTalbot
    May 28, 2010
Loading...

Share This Page