Thank You for your solution but can you please clarify in detail. My requirement is the two classes are already existing and I can not modify any of them. So, I cannot use constructor in superclass. Even using the statement "create object" for the same ref variable name that has been declared in superclass does not solve the purpose. The same run-time error is thrown that null reference is used.
↧