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 extension method in c# and how to use them?

882


How to prevent the error while updating ui control from another thread?

921


Difference between StackPanel and RelativePanel ?

969


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

955


What are cookies in c#?

915


What are c# collections?

851


Define a partial class?

867


Is c# good for beginners?

856


What will a loop recorder show?

920


Can we store different data types in arraylist in c#?

873


What are the advantages of using delegates in c#?

871


What is instantiating a class in c#?

966


What is the difference between a function and a method?

924


Is it not possible to store a boolean value as a variable?

827


Why do we use delegates?

807