The method can set only one of the public / protected / private

I am implementing an interface:

public interface Consultant { // some documentation here explaining it should throw 3 types of exceptions CellLocation suggest(GameBoard gameBoard); } 

It uses a different interface:

 public interface GameBoard { CellState getCellState(CellLocation cellLocation); } 

I wrote many methods, but just started to implement the method of all the important sentences. It looks like this:

 public class YourConsultant implements Consultant { @Override public CellLocation suggest(GameBoard gameBoard) { char[][] arrayBoardGlobal; Player currentPlayerGlobal; GameState gameStateGlobal; return null; } } 

But I get an error

The method proposed in the YourConsultant type can set only one of the public / protected / private

Of course, I can’t change it from the public to another, due to the interface.

What could be the reason? I did not find the answer here or on the network, probably because it reveals basic information about access modifiers. I am using Eclipse Neon.

+6
source share
1 answer

Ok, I found an error ... I left the lone "private" tag hanging in the air a few lines in front of YourConsultant: D. Your comments were useful, especially to those who requested a minimal, complete and verifiable example.

+7
source

All Articles