Praveen Kumar M K wrote: I get that...but what I wanted to know was when I put in a statement to print out Integer.MAX_VALUE, the compiler threw an error. It was referring to the variable rather than the class, which seemed a little iffy because I could still use Integer as a class when I created a reference of it.
It seems in contexts where either a variable name or a class name would be acceptable (such as Integer.MAX_VALUE), it assumes that you are referring to the variable. That makes sense, because if you need to use the class, you can use the fully qualified class name--java.lang.Integer.
Integer still works as a class name for things like declaring a variable, since in that context it can only be a type name, not a variable name.
When you said Context, am assuming its the general method/block context of a program.
What I meant by context was what I showed in my example code.