The Extract Constant refactoring makes your source code easier to read and maintain. It also helps you avoid using hard-coded constants without any explanations about their values or purpose.

For example, in the code fragment below, you could select a constant in the code

and press &shortcut:IntroduceConstant; (Refactor | Extract Constant).

This will result in the following: