您的位置:首页 > 编程语言 > Java开发

关于java方法的一些东西(摘自JLS)

2011-07-24 20:14 591 查看
Ⅰ、Method Modifiers
Method modifiers include: Annotation, public, protected, private, abstarct, static, final synchronized, native, strictfp
A compile-time error occurs if a method declaration that contains the keyword abstract also contains any one of the keywords: private, static, final, native, strictfp or synchronized.
A compile-time error occurs if method declaration that contains the keyword native also contains strictfp.
At runtime, a machine-code generator of optimizer can "inline" the body of a final method.
Ⅱ、Overriding , Hiding
A compile-time error occurs if an instance method override a static method.
A comiple-time error occurs if a static method hides an instance method.
BUT it permissible for an instance variable to hide a static variable vice versa.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  java generator include