This program run successfully . What is use of blank return in constructor as we know it return this implicitly . Is it is a bug in java or have some use .
class Demo
{
int salary;
Demo()
{
salary =11500;
//return this;(implicitly)
return;
}
public static void main(String... s)
{
System.out.println(new Demo().salary);
}
}
if(something == true)to me. Note that, just because someone wrote it, doesn't necessarily mean that it's good.