posted 19 years ago
ok...i have the following code:
i cant understand this syntax:
"set((byte)0); "
why to call "set" with the (byte)0???
cant i just put only 0(for eg: set(0)??? if i can..so what are the diffrences?
CODE]class Cord
{
private int x,y;
private byte color;
public void set(int a,int b, byte color)
{
this.x=a;
this.y=b;
this.color=color;
}
public void set(int a,int b)
{
x=a;
y=b;
}
public void set(byte clr)
{
color=clr;
}
public void set()
{
x=y=0;
set((byte)0);
}
public void set(int a)
{
x=a;
y=a;
}
public boolean equals(Cord otherCord)
{
if (otherCord.x==x && otherCord.y==y)
return true;
else
return false;
}
}
[/CODE]