i have a class squirrel . i want to make a counter for object , when object created it should increase and object name will store as "s"+counter
so i can differentiate object.
i tried this but i know it's wrong
public class squirrel extends Actor { int count=0; String name; public squirrel() { count++; name="s"+count; System.out.println(name); GreenfootImage image = new GreenfootImage(10, 10); image.setColor(Color.RED); image.fill(); setImage(image); }