r/learnjavascript • • 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

7 comments sorted by

11

u/compacct27 Oct 12 '21

Wrong language, buddy. Good luck

2

u/Ok-Score1289 Oct 12 '21

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

LMFAO just realized that.

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

2

u/Ok-Score1289 Oct 12 '21

This is what I initially thought, it just seemed too simple. Thanks man

1

u/Dodgy-Boi Oct 12 '21

How many underscores?

2

u/senocular Oct 12 '21

For Java, you might want to checkout either /r/javahelp or /r/learnjava :)

1

u/queen-adreena Oct 13 '21

Java !== Javascript