Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / ranjeet saini

it does not throw an exception
bcoz we can create private constructor if we have static member in class
in this we can create a reference object with the help of static method.
class A
{
private A()
{
C.w.l(" Hi");
}
public static display()
{
return new A();
}
S V M ( S[] args)
{
A a=a.display()
}

}

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between list and ilist in c#?

886


What are the different types of assemblies available and their purpose?

912


How do I get deterministic finalization in c#?

1066


Is it possible to inline assembly or il in c# code?

1040


Whats an assembly? Describe the importance of assembly?

910


Which string method is used for concatenation of two strings in c#?

1016


What does f mean in c#?

910


What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?

1150


What is binding in c#?

910


What is uint c#?

910


What are tuples c#?

1001


What is the difference between add and addrange in c#?

1012


Name some properties of thread class.

1007


What are assemblies?

948


Can we have two main methods in c#?

971