Answer the question
In order to leave comments, you need to log in
Why can't I access methods through a class?
there is a class A which has private field getters, for example public int getX() {retutn this.x} . When I access the getX() method from class B through class A, that is, A.getX(), then an error occurs, and when I declare a class variable of type A a, the compiler already sees the method through a.getX().
1. Please explain what is the joke here.
2. Declaration of variables like object can be stored on the heap before initialization?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question