Take 2 classes.i.e., Class A,Class B.
In Class B declare constructor as Private.But I have to access Class A using the constructor in Class B.
How is it possible?One interviewer told that Through getInstance() method it's possible to access Class A.e
Even Class B declare as Private.
How is it possible?
Explain with an example.
Questions by GeekAdmin answers by GeekAdmin
Showing Answers 1 - 3 of 3 Answers
Take 2 classes.i.e., Class A,Class B. In Class B declare constructor as Private.But I have to access Class A using the constructor in Class B. How is it possible?One interviewer told that Through getInstance() method it's possible to access Class A.e Even Class B declare as Private. How is it possible? Explain with an example.
Profile Answers by GeekAdmin Questions by GeekAdmin
Questions by GeekAdmin answers by GeekAdmin