public class a {
static int counter;
public static int getCounter() {
counter++;
return counter();
}
}
I know this class is not destroyed, is somewhere in my JVM, and the counter is updated from another class, i think is on my session, but can i do this, whitout getting this object from the session:
public class b {
public void dostuff() {
return a.counter();
/* Do this work, im not making any instance off class a or do i have to
make an intance, or do i have to get the right object from session to get the counter ???
Or can i make a intance off class b, to get the counter ???
*/
}
}
Frank
static int counter;
public static int getCounter() {
counter++;
return counter();
}
}
I know this class is not destroyed, is somewhere in my JVM, and the counter is updated from another class, i think is on my session, but can i do this, whitout getting this object from the session:
public class b {
public void dostuff() {
return a.counter();
/* Do this work, im not making any instance off class a or do i have to
make an intance, or do i have to get the right object from session to get the counter ???
Or can i make a intance off class b, to get the counter ???
*/
}
}
Frank