STATIC VS CONSTANT


STATIC readonly Fields are hold  reference types .

constant hold  value types




Static Variable:

1.Variable set at run time .
2.Can be assigned for reference types.
3.Initialized on constructors

Constant:
1.Variable set at compile time itself.
2.Assigned for value types only
3.must be initialized at declaration time
4.only primitive data types.






Comments