class apple(){
static Connection gh;
public apple(){
if (gh==null)//if gh=null get new connection that is only instantiate new connection if connection=null
gh=new Connection();
}
}
and i have class b
**************************************************************************
class b{
void shout(){
apple a=new apple();//instantiate the apple class and get connection
}//end method
}
and another class c
**********************************************************************
class c{
void doSomething(){
apple a=new apple();//instantiate the apple class and get connection
}
}
The Problem is instead of reusing an allready instantiated connection..the two application keep
instantiating new connections. And i am using "static" for the connection variable what can be the issue here, any suggestion would be welcome