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 abstraction with example?
What is the purpose of polymorphism?
What is encapsulation in simple terms?
What is encapsulation in ict?
What is the purpose of enum?
What do you mean by abstraction?
State what is encapsulation and friend function?
Which is not an object oriented programming language?
Can an interface inherit a class?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout<
What is overriding in oop?
What are oops functions?
What is oops and its features?
What is polymorphism oop?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?