==Stupid / newbie question. (Bad english, sorry)==
Is there a way to automatically set an object variable as its instance name?
ex:
//Create instance
Pawn p1 = new Pawn("white");
System.out.println(p1.getName()); //Will print p1
-
Pawn is an abstract class of Pieces which has the var:
String name;
String color;
and Pawn's constructor atm is:
public Pawn(String color) {
super("", color);
}