public class Str {
public static int count;
public Str() {
count ++;
}
public static void main(String[] args){
Str str1 = new Str();
Str str2 = new Str();
Str str3 = new Str();
System.out.println(str1.count);
}
}
Console:3