public class Igralec{ protected String ime; protected double x, y; protected int id; public static int koliko = 0; public Igralec (double x, double y, String ime) { this.x = x; this.y = y; this.ime = ime; id = koliko++; } public String toString() { return ime+" je na ("+x+", "+y+"). Njegov id je "+id+"."; } public Igralec (double x, double y){ this(x,y,"Igralec "+(koliko+1)); } public Igralec(String ime){ this(0,0,ime); } public static void main(String[]args){ Igralec a = new Igralec(1,4,"Kdo"); Igralec b = new Igralec(3,2); Igralec c = new Igralec("Jaz"); System.out.println(a); System.out.println(b); System.out.println(c); } }