Instance counter
0
instanceHits per object
Static counter (fixed demo)
0
staticHits shared — every tap bumps it
public class CounterDemo {
public static Integer staticHits = 0;
public Integer instanceHits = 0;
public void tap() {
staticHits++;
instanceHits++;
}
}Triggers and tests can re-use static state — be careful with recursion and test isolation; often reset statics in test setup when needed.