Hacker News new | past | comments | ask | show | jobs | submit login

I guess that shows how uniformly the convention is followed that I wasn't aware of that! I remember finding a class in a PR that had been renamed without renaming the file, and we were surprised it compiled. It must not have been a public class.

    $ echo "class Bar { }" > Foo.java
    $ javac Foo.java
    $ ls
    Bar.class Foo.java
    $



That is not a public class.

If you don't specify any access modifier, it is the same as internal in .NET.




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