Hi SriSri,
Something that the previous responders didn't underline is that your program DO HAVE a default constructor. The only time when
Java is not creating a default constructor for you is when you explicitly declare one (with or without parameters).
Line 1 is there to trick you into believing that it is a constructor declaration but it isn't because of the void return type (a constructor should not return anything) and this method is never called in your program. A call to it should look like
...
MyClass(5);
...
So on line 2 the default constructor is called and on line 3 a constructor that takes a long is called but this constructor was never declared.
Pallavi, to make it more clear, if you leave line 2 from the original code in your modified program then that line would not compile because by declaring:
MyClass(long param)// change is made here.
you prevent the compiler from generating the default constructor and now if:
MyClass a,b;
a = new MyClass(); // 2
then line 2 won't compile.