tags:

views:

88

answers:

3
A: 

This explains it well http://en.wikipedia.org/wiki/Constant_folding

Bhushan
+5  A: 

Constant folding is where the compiler finds expressions that contain compile-time constants and replaces them with the result effectively removing redundant runtime calculations.

// code
static final int a = 2;
int b = 30 * a;

// folding would create
int b = 60;
Nick Bedford
+1  A: 

Constant folding is the process of simplifying constant expressions at compile time. Terms in constant expressions are typically simple literals, such as the integer 2, but can also be variables whose values are never modified, or variables explicitly marked as constant

GK