Hey everyone, i'm working on a Java application and have ran into a bit of a snag due to my lack of knowledge...
I currently have 4 Java classes.
#1 Has the main thread and creates a new instance of my game and calls the startGame method.
#2 Has the Game class, methods, state vars, constructor, etc.
#3 Has the class Monster which serves as a ?superclass? to the different monsters in my game. This class contains state variables that all monsters need. The constructor for this class sets all the vars to 0 or null depending on their type.
#4 Is a monster that extends Monster. The default constructor sets it's actualName to "XXXXX" while another constructor allows for it to set a nickName while still setting actualName to "XXXXX".
When #4 tries to use the variables set as private in the Monster class I get an error saying those are private. But the #4 class extends Monster...
Shouldn't #4 have access to the Monster variables since it extends Monster? Setting the Monster state vars as public would have bad side effects on my game I think...
I need suggestions of how to tackle this problem... Thanks folks.