[Solved] I have an interface’s method that can’t be called [duplicate]


The problem is that the compiler tells me that he “cannot resolve the
method beStored(int).

That simply means that you’re attempting to pass an int type to the beStored method. If you look at the interface definition of this method again you’ll notice that you’re not obeying the contract that has been set.

public void beStored(char c);

in the code below read_character is most likely an int type rather than a character hence the error.

this.root_storable_data.beStored(read_character);

Solution

change this:

int read_character;

to this:

char read_character;

also change this:

StorableData storable_data = this.root_storable_data.beStored((int) read_character);

to this:

StorableData storable_data = this.root_storable_data.beStored(read_character);

9

solved I have an interface’s method that can’t be called [duplicate]