Can we have private constructor in our class file. When we
are trying to create instance for the class will it create
or throw error regarding that?

Answer Posted / saiish bhat

ya,we have private constructor.but it wont throw an exception.

but u cant create an instance of p.c.

it is not possible to inherit from that class also.

ex:
private class a()
{

}

class b : a
{ }

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there an equivalent to the instanceof operator in visual j++?

772


What is the difference between dynamic and var in c#?

702


What issues can be faced while delivering code?

1727


Can we make a Static Constructor Parameterized? Give Reason with your answer

808


How to find whether the application is run from inside ide or not?

821


Can we overload the main method in c#?

709


What is dynamic in c#?

680


What happens when thread sleep () method is called?

702


What's the difference between the debug class and trace class? Documentation looks the same.

759


How do I trim a space in c#?

680


What is disco?

730


what is full assembly reference

759


How do you serialize in c#?

669


Explain the access modifiers in c#?

708


What is string [] args in c#?

720