private attribute can or can not be inherited by subclass in Java?
===

Isn't that subclass inherits **everything** from superclass true? But subclass could not access it's superclass's private attribute/method, but can access it's own. So I wrote a test program. But it seems subclass has not one!


    class a {
        private void set() {
               System.out.println("a.set()");
        }
    }
    public class b extends a {
    //      private void set() {
    //      System.out.pritln("b.set()");
    //       }
            void f() {
                 set();
            }
            public static void main(String[] args) {
                 b b = new b();
                 b.f();
            }
    }

  


If I comment out  the set() method in b as the example does, it won't compile.

Any idea? Any  explanation  from JVM view ?