Answered Questions

  • Advantages of static class over class ?

    when to use static class and when to use normal class ?

    Sunil

    • Aug 31st, 2014

    WHEN SHOULD WE DO THIS: When we have a normal class and its methods being used very frequently in a given app, then it would speed up things if we made this class a static class with static methods. T...

    Knoxille_25

    • Aug 19th, 2014

    A static class can make your implementation simpler and faster because you do not have to create an object in order to invoke its methods. It is useful to organize the methods inside the class in a meaningful way, such as the methods of the Math class in the System namespace.

  • What are constructors in .Net

    Abinash Dinakaran

    • Dec 22nd, 2014

    Constructors are the member functions which has same name as class name. Constructors are used to initialize a value for a variable so that we can be able to avoid junk values thrown to a variable.

    sunil

    • Sep 24th, 2014

    Constructor is the special type of methods, which is called when we crate the object for the class.
    Constructor will have same name as class name.
    overloaded constructor can also be there.

  • How do you make a class not instantiable

    A) Making class as AbstractB) Having a Private constructorC) Making the class sealedD) Both A & B

    Naveen Kumar Shivanadri

    • Sep 8th, 2016

    Answer is A is always correct and B is also correct only the situation when the class does not have the static methods on it (in the question, there is no mentioned that there is no static method in it)
    So, only A is correct answer.

    Naveen Kumar Shivanadr.

    ramya

    • Oct 13th, 2015

    Making class as Abstract