KnowledgeBoat Logo
|

Computer Science

Define constant with an example.

Values & Data Types Java

11 Likes

Answer

The keyword final before a variable declaration makes it a constant. Its value can't be changed in the program.

Example:

final int DAYS_IN_A_WEEK = 7;

Answered By

6 Likes


Related Questions