sehqlr / menne-lecture-java

Mike Menne's Java Class
0 stars 0 forks source link

Java Constants #2

Closed mpmenne closed 10 years ago

mpmenne commented 10 years ago

In Java, it's convention to define a constant as a static final. Static means they are can be accessed via the class (you don't need an object to access the variable). Final means that they can't change.

Since all of these variables are only used within this class we'll make them private as well. Private can only be accessed from within the class.

i.e

private static final String chasm

Check out this video :-) http://tv.launchcode.us/#/videos/java_public_private_protected?lesson=Java