An unintended interaction

Sam Pullara spullara at gmail.com
Tue Oct 29 17:40:11 PDT 2013


I kind of like the idea that the interface might choose its application implementation based on the arguments passed on the command line.  Sam    

---Sent from Boxer

On 30/10/2013 10:00 AM, Brian Goetz wrote:

> If you have:

>

>    public interface Foo {

>      public static void main(String[] args) {

>        System.out.println("Foo!");

>      }

>    }

>

> you can say

>    java Foo

>

> and it will run.  Is that what we intended?  Should the java launcher

> detect this and not look for main() methods in interfaces?



Seems harmless to me but probably implies a need to update documentation  
in a number of places.



David





More information about the lambda-spec-observers mailing list