JAVA Day 25/30 #java #interview #javadeveloper #javainterviewquestions #corejava #freshers #code

preview_player
Показать описание
Java MCQ: Which Keyword Defines a Constant Variable? (Final vs Static vs Const)

🔍 Question:
Which keyword is used to define a constant variable in Java?
A) final ✅
B) static
C) const
D) immutable

💡 Correct Answer: A) final

The final keyword makes a variable unchangeable (constant) after assignment.

const is a reserved keyword in Java but not used.
#Java #MCQ #Programming #CodingInterview #JavaFinal #LearnJava

static is for class-level variables, not constants.
Рекомендации по теме
Комментарии
Автор

✅ Answer: A) final

🔍 Explanation: In Java, the final keyword is used to declare a constant variable, meaning its value cannot be changed once assigned. Unlike other languages, Java does not use const.

EzzyByte