Skip to content

'class field' might be more in place than 'static field'  #22805

Open
@DawMuld

Description

@DawMuld

_A field is a variable that is associated with a class or with an instance of a class.

A field declared with the static modifier defines a static field. A static field identifies exactly one storage location. No matter how many instances of a class are created, there's only ever one copy of a static field.

A field declared without the static modifier defines an instance field. Every instance of a class contains a separate copy of all the instance fields of that class._

I guess that a static modifier defines a class field, as the absence of this modifier makes it an instance field and the article seems to intent to explain the differences between variables associated with a class or with an instance. Also, the statement of a static modifier making a static field seems quite redundant


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions