the difference between reference and object in java [duplicate]

the show() method gives you information about the refference itself( about a). Accesing a member of the object through “a” when “a” is not assigned to any object is illegal. show() will only display information regarding the “a” variable.
Your show() method being static will run as thanks to your class. It is not bound to your variable

Leave a Comment