Hi, got a question about printing object variables .
If i create:

main class
*********************
Home first = new Home();

first=23;

System.out.println(home);
*********************'

class Home
{
public double x;
}

Why this prints something like @45de23g and after i add next method in Home class
in prints readable value i.e String value to that unicode.

public String toString()
{
return(x);
}

Can anyone explain why these both cases happen. Even thou i don't call that toString method at all.??

Thanks.