In Java, to access any properties of a given class, you have to create the object first.
Therefore if you want to access the properties of class
, then you have to create a instance of class
For more information click here.
"..Do java always request for getter() & setter() methods to access variables.."
Java suggest you not to access the properties directly, use getter/setter method to access the properties. It is a coding convention.