R
Razvan
Hi !
Take a look at the following code:
public class CDummy
{
public static void main(String args[])
{
System.out.println("CDummy.");
CDummy dmy = new CDummy();
}
CDummy() {System.out.println("CDummy()");}
void CDummy() {System.out.println("void CDummy()");}
}
The constructor "CDummy()" and the member function "void CDummy()"
differ only by the return type. Normally, this is disallowed but since
constructors can only appear after a 'new' operator there is no
ambiguity, so this is allowed !!!
Well.. no question here. I hope I didn't messed up the explanation)
Regards,
Razvan
Take a look at the following code:
public class CDummy
{
public static void main(String args[])
{
System.out.println("CDummy.");
CDummy dmy = new CDummy();
}
CDummy() {System.out.println("CDummy()");}
void CDummy() {System.out.println("void CDummy()");}
}
The constructor "CDummy()" and the member function "void CDummy()"
differ only by the return type. Normally, this is disallowed but since
constructors can only appear after a 'new' operator there is no
ambiguity, so this is allowed !!!
Well.. no question here. I hope I didn't messed up the explanation)
Regards,
Razvan