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 delegates in c# and uses of delegates?

845


Can we override constructor in c#?

913


Explain About stateless and state full web service

984


Can constructor have return type c#?

1015


Explain how do you debug an asp.net web application?

907


What does args mean in c#?

897


What is a web service in c#?

1133


What is use of list in c#?

857


Explain get and set accessor properties?

883


What is uint64_t?

978


What is polymorphism c# example?

928


What do you understand by an Implicit Variable?

1003


What is delegate in c# interview questions?

990


If multiple interfaces are inherited and they have conflicting method names; What will happen ?

956


What is deferred execution in c#?

916