Field

A field is a variable declared inside a class. It stores the state of the object (or class, if the field is static).

The field is created as follows:

static int apoptotic

where:

• static - indicates that the field is static (applies to the class). If not specified, the field is considered non-static (applies to an object of the class).
• int - the data type contained in the field.
• apoptotic - the field name.

Inside the class, the field is declared as follows:

// Circle class
public class Circle {

   // Class fields:
   // radius - circle radius (double data type)
   private double radius;

}

Fields can be static (when declaring them, the “static” modifier is indicated; such fields apply to the entire class, and not to specific objects of this class) and non-static (they refer to specific objects of the class).

A static field is accessed through the name of the class itself, for example:

PhysiCellConstants.apoptotic;

• PhysiCellConstants - the class name.

A non-static field is accessed through the name of an object of some class, for example:

Cell cell1 = new Cell(CellDefinition cd, Model model);

сell1.position;