Suppose I have 3 Java classes A, B and C
I need to create an object of class C, which is used in both A and B, but the problem in creating the object separately is that the constructor of class c is called 2 times. But I want the constructor to be called only once.
So, I want to use an object created in class A in class b.
Vivek source share