Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+12 votes

Do we call static void final because its a constant.

asked ago in CSC211_Winter2018 by (955 points)

3 Answers

+6 votes

Yes, you should put constants within the class but outside of the main method. However, do not include the “void” part.

For example, if you wanted to declare an integer named SIZE it would be:

public static final int SIZE = 3;

Hope this helps.

answered ago by (3.8k points)
0

Thanks

–1 vote

Yes public static final int and then the name of your constant in all uppercase, and it goes before your main method!

answered ago by (2.6k points)
–1 vote

Yes public static final int and then name of your constant in all uppercase, and it goes before your main method!

answered ago by (2.6k points)
...