Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #19205

Re: public <E> String FUNCTIONNAME( ?,?)

Newsgroups comp.lang.java.programmer
Date 2012-10-09 10:15 -0700
References <6d2e79a9-7f37-4558-89b1-d451298b9890@googlegroups.com> <k51bm5$etp$1@dont-email.me>
Message-ID <fea256a3-09a6-49ff-918d-67fe2482a207@googlegroups.com> (permalink)
Subject Re: public <E> String FUNCTIONNAME( ?,?)
From Lew <lewbloch@gmail.com>

Show all headers | View raw


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

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

public  <E>  String     FUNCTIONNAME(  ?,?) waiter.james1991@gmail.com - 2012-10-09 01:48 -0700
  Re: public  <E>  String     FUNCTIONNAME(  ?,?) Roedy Green <see_website@mindprod.com.invalid> - 2012-10-09 02:03 -0700
  Re: public  <E>  String     FUNCTIONNAME(  ?,?) Jeff Higgins <jeff@invalid.invalid> - 2012-10-09 10:23 -0400
    Re: public  <E>  String     FUNCTIONNAME(  ?,?) Lew <lewbloch@gmail.com> - 2012-10-09 10:15 -0700
      Re: public  <E>  String     FUNCTIONNAME(  ?,?) Jeff Higgins <jeff@invalid.invalid> - 2012-10-09 17:30 -0400
        Re: public  <E>  String     FUNCTIONNAME(  ?,?) Lew <lewbloch@gmail.com> - 2012-10-09 16:08 -0700
          [OT] The addendum and Meta [was]Re: public <E> String FUNCTIONNAME( ?,?) Jeff Higgins <jeff@invalid.invalid> - 2012-10-10 05:51 -0400
            An addendum Jeff Higgins <jeff@invalid.invalid> - 2012-10-10 06:04 -0400
  Re: public  <E>  String     FUNCTIONNAME(  ?,?) Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-09 17:40 -0400
  Re: public  <E>  String     FUNCTIONNAME(  ?,?) Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2012-10-09 23:47 +0200
    Re: public  <E>  String     FUNCTIONNAME(  ?,?) Arne Vajhøj <arne@vajhoej.dk> - 2012-10-09 18:09 -0400
      Re: public  <E>  String     FUNCTIONNAME(  ?,?) Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2012-10-10 00:43 +0200

csiph-web