In your code above, staticT, did get initialized. If you can see your code
This particular statement is checking whether null and staticT point towards the same object. They don't
thats why the output is false. If you amend your code and put a printout statement before the equality,
you will see staticT, does refer to an object.
but my question remains can a constructor throw an exception
posted 9 years ago
Yes a constructor can throw an exception. There are many articles over google.
Just type, Can constructors throw an exception OR not? Actually, by throwing an
exception only from the constructor an object creation can be avoided. In your case
object t is not created.