DizitalNovice
I don't want IT
Date d = new Date();
System.out.println(d);
using this statement we can see that d has got some value and can be printed. I want to make a similar class, which will assign a value to the object and not create members within the object.
Say,
Class cls{
cls(){
...
}
}
so when I write
cls cmember = new cls();
I can print SOPln(c); and not SOPln(c.<xyz>);
My Ideas:
Returning a value from constructor is not possible.
Can I know cmember from from cls, ie can I knw what variable name was used to Initialize a class?
System.out.println(d);
using this statement we can see that d has got some value and can be printed. I want to make a similar class, which will assign a value to the object and not create members within the object.
Say,
Class cls{
cls(){
...
}
}
so when I write
cls cmember = new cls();
I can print SOPln(c); and not SOPln(c.<xyz>);
My Ideas:
Returning a value from constructor is not possible.
Can I know cmember from from cls, ie can I knw what variable name was used to Initialize a class?