Can I have an empty Java class? -
I'm making a grid-based game.
I have to apply a set of constraints that have created random positions within the grid, I have created an abstract class AlifeForm , which keeps the general way for each item within the grid. Obviously, intangible classes can not be started, so I was going to create a new class AObstacle , which would expand ALifeForm .
The only problem is, my obstackle class is not special. All methods are needed which are in ALifeForm .
Can I have an empty square? Is this bad programming practice? And if so, what can I do instead?
Of course ...
class AObstacle {} > (Plus the succession model you are using.) There is nothing stopping you from doing so.
Remember that class is not really a matter that you are defining. A type is the class that builds only the language / syntax that describes the type. If the description is different from the type heritage model being different, then there is nothing else to add to it.
Although you are adding a thing you are giving it a name, it is not very like, but with a solid name (especially in a styled type environment) Defining an economic concept very is important in your type now in the system except for other types of identity. If things are added later, then there is a place to add them without restructuring and breaking changes.
Comments
Post a Comment