Saturday, 7 September 2013

Can i invoke a method without using that dot operator

Can i invoke a method without using that dot operator

I have searched on many sites and according to them the answer is no, Why
does this prog in Java invoke this method without a dot operator?
class A
{
public String toString()
{
return "Hello";
}
public static void main(String ar[])
{
A a=new A();
System.out.println(a);
}
}

No comments:

Post a Comment