N
nicol
hi
i know ToString is one of methods in object class . & i use it in my
program but i want to show it results when i run program(show it on
screen)
using System;
namespace inheritance_2
{
class Program
{
static void Main(string[] args)
{
point a = new point(3, 7);
a.ToString(); //***********
}
}
}
public class point
{
protected int x, y;
public point()
{
}
public point(int xvalue, int yvalue)
{
x = xvalue;
y = yvalue;
}
public override string ToString()
{
//return base.ToString();
return "[" + x + "," + y + "]"; // whant to show this
result
}
} // end class point
and i want to know what is the usage of ToString
thanks
i know ToString is one of methods in object class . & i use it in my
program but i want to show it results when i run program(show it on
screen)
using System;
namespace inheritance_2
{
class Program
{
static void Main(string[] args)
{
point a = new point(3, 7);
a.ToString(); //***********
}
}
}
public class point
{
protected int x, y;
public point()
{
}
public point(int xvalue, int yvalue)
{
x = xvalue;
y = yvalue;
}
public override string ToString()
{
//return base.ToString();
return "[" + x + "," + y + "]"; // whant to show this
result
}
} // end class point
and i want to know what is the usage of ToString
thanks