Originally posted by smyle khanna:
is it necessary tht a class must havea default constructs?
thanks in advance
Smyle[/QB]
It is not necessary for a class to have a explicitly declared default constructor. If you do not specify one, the compiler will generate a default constructor for you. For example, you could have the following code for your example:
Although there is no explicit constructor, the compile will generate one that looks like:
public Second() {};
The above code is an example of a static initializer that executes when the class itself loads before object instantiation (and thus, the constructor) occurs.