Constants

Some data, such as mathematical constants, never changes. Take the number π. Approximately it is always equal to 3.14 and cannot change.

To access such data in Java, it is customary to use constants.

final var PI = 3.14;
System.out.print(PI); // 3.14

Constants are usually called uppercase letters with _ as a separator. A constant, like a variable, can be used in any expression. The only restriction is that the constant cannot be changed, which sounds quite logical.

instructions

Create the constant DRAGONS_BORN_COUNT and write the number 3 in it - the number of dragons born to Dayenerys.


Exercise available only for signed users.

Please sign in with your GitHub account, this is necessary to track the progress of the lessons. If you do not have an account yet, now is the time to create an account on GitHub.