In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Adapter mode
-
1. If there are many methods in the interface, but only care about one or more of them when using the interface, if you use the conventional way, you need to implement each method, and you can create a class to implement the interface. Empty implementation of the unconcerned method, keep the concerned method unchanged, after the defined new class inherits the abstract class, you can implement the concerned method. This pattern is called the adapter pattern and is often used in the handling of button click events in UI designs.
Polymorphisms
-
1. Use the object defined by the parent class to reference the subclass. The interface is also polymorphic.
two。 Prerequisites:
* need to inherit or implement
* actions that need to be overridden.
In 3.java, attributes are the most important, all the data is stored in attributes, and the method is just a stack, which pops up after execution.
Properties cannot be overridden and methods can be overridden.
4. The number of stack blocks depends on the number of threads (each thread corresponds to one stack area), and the entire java program has only one stack area.
5. The characteristics of polymorphism
Member function
Compile time
To view the class to which the reference variable belongs
Run time
Member variable
Only look at the class to which the reference variable belongs
Inner class
Features: inner classes can access members of external classes, including private members
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.