Circle c = circles[i];
someValue = c.getNumber()
c.callMethod();
However, what happens when you actually want to copy the obhect entirely, in the same vein as int i = j;?
![]() |
Before doing this, understand that ^. Object =/= values, they are unique. |
Circle c = circles[i].copy();
if (c == circles[i])
{
Console.WriteLine("objects are the same");
}
else
{
Console.WriteLine("objects are different");
}
And for the fun of it, the same in Java:
String notCSharp = new String(arrayStrings[i]);
if (notCSharp == arrayStrings[i])
{
System.out.print("objects are the same");
}
else
{
System.out.print("objects are different");
}
And that's about that.
No comments:
Post a Comment