Public class inside package can't see public interface?

Viewed 188

I have a class:

package Member;
public class Player implements Character{
...
}

and I have interface that is not inside the package:

public interface Character{
...
}

I think that public intefaces and classes are visible to each other no matter if they are in the same package, so why I can't implement Character in the Player class? I have error: Cannot resolve symbol 'Character'

1 Answers

If the interface (or any other class/enum you use) are in a different package, you need to either fully qualify it:

public class Player implements org.somepackage.Character {

or import it:

import org.somepackage.Character;
public class Player implements Character {
Related