Answered Questions

  • Which of the following statement is invalid with regards to constructor

    A) Constructors should have the same name as class nameB) Constructors have to be public so that class can be instantiatedC) Constructors can not be overloadedExplanation: Constructors can be overloaded with different parameters

    S.M.Sadrul Islam Asif

    • Feb 5th, 2015

    B,We can have private constructor.

    Manish

    • Jan 7th, 2015

    B&C are wrong. B : In case of singleton we create a private constructur for class. A static method in this class calls the constructor nad returns the class instance. C : We can have any number of co...