Write a statement in Java, to declare a constant MAX and store the value 100 in it
Answers
Answered by
2
Full Co de::
class Demo{
public static void main(String [] args) {
final int MAX = 100;
}
}
==> We used final access modifier which means we cannot change the value of the variable and if we try to do so, it will generate an error.
I hope that my answer helps you...
Similar questions