copy code,drag or close
A Field is a variable defined within a class.
They are the basic building blocks in most classes or structs.
Often referred to as instance variables or class variables they are exposed or
made accessible via a number of keywords used when they are created.
These keywords can be understood as a different scales of accessibility.
Their purpose is to store data and references for the classes or struts that contain them.
public
Access is unlimited. Any consumer of data values public fields, due to this they should only
be used with caution.
Internal
Only other types within the same namespace as the class containing the internal fields
can access them, internal then refers to being in the same Field is a variable defined within a class.protected
This means that access is resticted to classes that are inherited or extended from the class.
An important design principal for Oject Orientated code ability to inherit from other classes.
Protected classes mean only themselves and any others that are derived from them can access this field.
protected internal
This is a two-keyword term, combining both meanings