Can we create object of class with private constructor?
Answer Posted / rajneesh
Public class mainclass
{
private static mainclass _obj = null;
private constr()
{
}
public static mainclass obj
{
get
{
return _obj
}
}
}
after that you can access the obj in other class .
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Why is object oriented programming so hard?
Which method cannot be overridden?
What are the benefits of polymorphism?
What are the types of abstraction?
State what is encapsulation and friend function?
What is the main purpose of inheritance law?
What is abstract class in oops?
What is data binding in oops?
Who invented oop?
what is the drawback of classical methods in oops?
Where is pseudocode used?
What is polymorphism and types?
How is polymorphism achieved?
What is object and class in oops?
What is an example of genetic polymorphism?