Very simple: just write the initialization as follows:
public class cls{ public int x = 0; public int y = 0; public int z = 0; public cls(int x, int y){ init(x,y,0); } public cls(int x, int y, int z){ init(x,y,z); } public void init(int x, int y, int z ) { this.x = x; this.y = y; this.z = z; } }
InsertNickHere
source share