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 a satellite assembly in c#?

943


What is extension method in c sharp?

854


What to implement on my class Finalize or IDisposable

925


How do you prevent a class from being inherited?

864


What are managed providers?

942


What is a jagged array?

866


How to rotate an Image in C#?

1035


What is use of abstract class in c#?

878


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

932


How to use nullable types in .net?

937


What is meant by unicode characters?

925


Describe the types of comments in c#?

857


How can you achieve run time polymorphism in C#?

965


What is type cast in C#?

949


How many types of polymorphism are there?

886