In the public class there is a static field that I dream to modify (increment by one) if the number of class objects increases.
public class Man{ private static int allMans = 0; public void addMoreMans() { this.allMans++; } public static void main(String[] args){ Man man = new Man(); man.addMoreMans(); } } It does not work. Oh yes! Integer allMans static, what this !? I appeal through Man.allMans also does not want. And how to contact him?
allMans++;? - YurySPb ♦