Three characteristics of java object-oriented
Three characteristics of java object-oriented: "encapsulation, inheritance and polymorphism". For more Java technology knowledge, please log in to the crazy software education official website. Wechat search wechat: Crazy software, participate in 2015 preferential activities, and have the opportunity to get preferential pain relief
Taking this article as an example, the variables in the user class are private variables, which can only be assigned by creating an object (the constructor is called automatically at this time).
The user class can only be accessed by the public method API ().
The admin class inherits the user class, calls its constructor, and overrides the method_ 1 method, a special method power () is added.
User file
The above is the whole content of this article. I hope you can like it.