|
How to count the number of instances of MIDlets |
|
|
There can be many instances of MIDlets that share classes and data between them. Implement a MIDlet suite that contains a class called Counter, intended to keep count of the number of instances of MIDlets that are running at any given time.
public class Counter {
private static int instances;
public static synchronized void increment( ) {
instances++;
}
public static synchronized void decrement( ) {
instances--;
}
public static int getInstances( ) {
return instances;
}
}
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.