Programming MCQS - QUESTION DETAILS

How do you declare a constant in an interface in Java?
A. const int CONSTANT = 5;
B. final int CONSTANT = 5;
C. static final int CONSTANT = 5;
D. public final int CONSTANT = 5;

'static final' is used to declare constants in an interface in Java.

Similar Questions

What is the purpose of the 'break' statement in a switch statement?






What is the purpose of the 'sizeof' operator in C?






What is the default value of a boolean variable in Java?






Which function is used to read a character from the standard input in C?






In C, how do you declare a constant?






How do you declare an array of function pointers in C?






Which operator is used for object instantiation in Java?






Which of the following is not a primitive data type in Java?






What is the output of printf("%d", 5 + 3 * 2);?






How is a single-line comment written in C?