In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you how to use reflection to achieve bridging in Java, the content is concise and easy to understand, it can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
/ * add the Method array to uniqueMethods * @ param uniqueMethods * @ param methods * / private void addUniqueMethods (Map uniqueMethods, Method [] methods) {for (Method currentMethod: methods) {/ / ignore the bridge method if (! currentMethod.isBridge ()) {/ / get the method signature String signature = getSignature (currentMethod) / / check to see if the method is already known / / if it is known, then an extended class must have / / overridden a method / / uniqueMethods does not contain this method signature, add if (! uniqueMethods.containsKey (signature)) {/ / add uniqueMethods.put (signature, currentMethod);}
In order to avoid interference to friends who have not seen this source code, I added some comments to the code. Here, I would like to thank the source code boss of Taro Road. Luo this werewolf is really strong. I recommend you to pay attention to it. Read the source code together and go bald together.
Back to the point, I wonder what the isBridge of currentMethod.isBridge () is for, so open it and have a look.
Public boolean isBridge () {return (getModifiers () & Modifier.BRIDGE)! = 0;} @ Overridepublic int getModifiers () {return modifiers;} the above is how to bridge with reflection in Java. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
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.