Static methods on interfaces

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Dec 17 09:35:55 PST 2012


On 17/12/12 17:25, Stephen Colebourne wrote:
> Thanks. The invocation guarantee looks good.
> Stephen
Note: the compiler is currently less strict, so it allows non-type 
qualifiers for static interface method calls.

Maurizio
>
> On 17 December 2012 17:20, Brian Goetz <brian.goetz at oracle.com> wrote:
>> This is the plan of record.  If you're looking for some sort of
>> yacht-collateralized guarantee, though, we don't offer those.
>>
>> More strongly, the only way to invoke a static method on an interface is:
>>
>>     DeclaringInterfaceName.methodName(args)
>>
>> Not subinterfaces, not subclasses, not instances.
>>
>>
>> On 12/17/2012 12:10 PM, Stephen Colebourne wrote:
>>> Can we (JSR-310 and more generally) rely on static methods in
>>> interfaces being in JDK8? It affects a design decision currently in
>>> progress ;-)
>>>
>>>
>>> http://mail.openjdk.java.net/pipermail/lambda-dev/2012-December/006969.html
>>>
>>> Also, can we assume that static methods are in not inherited by
>>> implementors (unlike static constants on interfaces)?
>>>
>>> Stephen
>>>



More information about the lambda-dev mailing list