Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That will not compile with javac, as it is not a method of a class.


That code will it just needs to be in the proper context. No the same file will not compile, even if only because javac needs files to end with .java .


Java has "unnamed classes" now which makes this work.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: