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
What is object in oops?
Get me an image implementation program.
Give two or more real cenario of virtual function and vertual object
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
Templates mean
given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy
What causes polymorphism?
write knight tour problem which is present in datastructure
Is data hiding and abstraction same?
Plese get me a perfect C++ program for railway/airway reservation with all details.
What do you mean by variable?
What is difference between class and object with example?
What does no cap mean?
Who invented oop?
Is react oop?