Other |
---|
5.0Resolved |
Duplicate :
|
The string returned by toString() shows the bridge methods as having the volatile modificator. Run the following code: import java.lang.reflect.Method; public class BridgeMethodTest { public static void main(String[] args) throws ClassNotFoundException { Class cl = Class.forName("java.lang.String"); for(Method m : cl.getDeclaredMethods()) { if (m.isBridge()) System.out.println(m); } } } The result is: public volatile int java.lang.String.compareTo(java.lang.Object)