I have multiple different implementations of an object, which implement this custom interface
I made called Board
.
Board
contains a method that looks like the following
public void ConvertFromString(String formattedString);
Each object implementing Board
calls ConvertFromString()
in its constructor.
Looks like the following.
public void BoardImpl1 implements Board
{
public Board(string B)
{
ConvertFromString(b);
}
public void ConvertFromString(String formattedString)
{
//do some parsing on string and set up the BoardImpl properties
}
}
ConvertFromString being public causes a warning, so the best practice workaround would be to make BoardImpl
final. Is there a better way to write this?