i have a question on the following...
suppose, i have a class
class sample
{
int x;
float y;
String s;
sample(int par1,float par2,String par3)
{
x =par1;
y = par2;
s = par3;
}
}
now i am creating an object...
sample p = new sample(12,45.60,"test");
my question
_____________
now if i do >> String.valueOf(p) what it will return???
will it return a String represntation of object p??????? but what is
the meaning of that??
does it mean after conversuion object p will have only field String
(viz "test")??? other fileds will be lost???
i am not sure about the meaning of the String representation of an
object.can you explain what does it mean???
another question
________________
instead of doing String.valueOf(p) if i did p.toString()
would it give the same result??????
can you give a small code to experiment what is going on ??