Java Reference

Java Reference Home | Smart Soft Home

static

Category

Field modifiers

Description

A static field is opposite of instance field. While each instance of a class has its own copy of instance fields, each instance shares a single copy of static fields.

Example

class Circle{

  int radius=10;

  static double pi=3.14;

}