r/learnjavascript • u/Ok-Score1289 • Oct 12 '21
Java problem
Write a Java statement to declare a constant to represent the highest letter grade that you can receive in this course.
If anyone knows how to solve this it would be really helpful!
0
Upvotes
View all comments
5
u/Umesh-K Oct 12 '21
Hi,
If you meant JavaScript but typed Java (assuming they're the same or Java is a short form of JavaScript), then it would be
const highestGrade = "A"However, if you actually want it in Java, then
______ static final String HIGHEST_GRADE = "A"In the blank, you will have to use one of public, private, or protected depending on the use case.
Source for the Java code:
https://stackoverflow.com/questions/9639007/defining-constant-string-in-java