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 / balamurugan

we can create private constructor.it wont throw any
execption..but we cant create object for that class

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the Types of assemblies that can be created in dotnet

905


What is the difference between protected and private?

718


what are the differences between a class and structure

796


What's the difference between system.string and system.text.stringbuilder classes?

785


Can we declare class as protected?

779


Is arraylist type safe in c#?

738


How do you serialize an object?

736


How to rotate an Image in C#?

820


What are the main reasons to use c# language?

724


What's the implicit name of the parameter that gets passed into the set method/property of a class?

811


What does get set mean in c#?

709


What is difference between dictionary and list in c#?

700


what is a constructor? What is a destructor?

765


How does return work in c#?

765


Can a sealed class be used as a base class?

736