ExamVeda
Login
Home
Data Types and Variables
?

What is the keyword used to declare a constant value in Java?

Answer & Solution
Correct Answer: Option C
The correct answer is Option C: final.

In Java, the keyword used to declare a constant value is final.

Here's the breakdown:

Option A: constant - There is no constant keyword for declaring constants in Java.

Option B: const - There is no const keyword for declaring constants in Java. The const keyword is not used for this purpose in Java.

Option C: final - This is the correct keyword for declaring a constant value in Java. When you declare a variable as final, it means its value cannot be changed after initialization, making it a constant.

Option D: static - The static keyword is used to declare static variables and methods but not specifically for declaring constants.

So, the keyword used to declare a constant value in Java is final.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.