17.5.2 Static and instance methods
来源:互联网 发布:金域名人国际酒店小姐 编辑:程序博客网 时间:2024/04/30 10:45
When a method declaration includes a static modifier, that method is said to
be a static method. When no
static modifier is present, the method is said to be an instance method.
A static method does not operate on a specific instance, and it is a
compile-time error to refer to this in a static
method.
An instance method operates on a given instance of a class, and that
instance can be accessed as this (§14.5.7).
When a method is referenced in a member-access (§14.5.4) of the form E.M,
if M is a static method, E must
denote a type that has a method M, and if M is an instance method, E must
denote an instance of a type that has a
method M.
The differences between static and instance members are discussed further
in §17.2.5.
be a static method. When no
static modifier is present, the method is said to be an instance method.
A static method does not operate on a specific instance, and it is a
compile-time error to refer to this in a static
method.
An instance method operates on a given instance of a class, and that
instance can be accessed as this (§14.5.7).
When a method is referenced in a member-access (§14.5.4) of the form E.M,
if M is a static method, E must
denote a type that has a method M, and if M is an instance method, E must
denote an instance of a type that has a
method M.
The differences between static and instance members are discussed further
in §17.2.5.
- 17.5.2 Static and instance methods
- 17.5.2 Static and instance methods
- Static Methods, Class Methods, and Decorators
- Lock on Static and non-static Methods
- The Default Methods And Static Methods In Java Interface
- Factory methods are static methods that return an instance of the native class(保护CONSTRUCTOR)
- 17.6.1 Static and instance properties
- 17.6.1 Static and instance properties
- 17.7.3 Static and instance events
- Java – Static Class, Block, Methods and Variables
- Mocking static methods (PowerMock )
- Static/Class methods
- Static methods 静态方法
- Example 2 : Multi Sampling And Filtering Methods
- factory | factory methods | static factory methods
- USING STATIC IMPORTS FOR CONSTANTS AND METHODS(使用静态导入引用常量与方法)
- Java核心思想学习笔记002(Static Fields and Methods)
- Purpose of Instance Methods vs. Class Methods in Objective-C
- 17.4 Fields
- IDEA,配置备忘
- ASP生成静态页面的方法(转)
- 17.5 Methods
- 17.5.1 Method parameters
- 17.5.2 Static and instance methods
- 17.5.3 Virtual methods
- 17.5.4 Override methods
- 17.5.5 Sealed methods
- 17.5.6 Abstract methods
- 17.5.8 Method body
- 在ASP中用集合成批操作数据库 (转)
- 17.5.9 Method overloading
- 17.6 Properties