Skip to content
Advertisement

Tag: abstract

How can I implement interface correctly?

I am doing homework of making a simple calculator using java and interface in java. but the class that implements java gives error saying here is the code Answer There are a couple of issues here. First, since BasicCalculator is a public class, it needs to be defined in its own file named BasicCalculator.java. Second, the method names in BasicCalculator

How to get the class of a static object attribute

I have a parent class Tile and inherited classes Walltile, FloorTile, EntityTile. Each inherited class have BufferedImage attributes that is related with its name. I instantiate Tile and then i cast to the specific class, like: But i need to know if this Tile object is WallTile, FloorTile or EntityTile. For that i have the sprite attribute which corresponds to

Advertisement