Accessing inherited class variables in Java
•
Java
If you inherit from activities that declare certain member variables, how do you access them in subclasses that perform inheritance?
Solution
You can use any constructor or non static method or initialize this in your program Membername access public or protected member names
Private or package level members (accessed from subclasses in different packages) cannot be accessed directly and need to be accessed through non privileged interfaces (such as public getters)
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码