lainchan / λ

(untitled)

Anonymous · 2015-11-02 19:38
==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); }
Anonymous · 2015-11-02 19:49
there's a beginner general, use the catalog pls <55 https://lainchan.org/λ/res/5683.html