标签:
源代码:
package demo;
import java.util.*;
class How {
public static int a=0;
public How(){
a++;
}
public int getValue(){
return a;
}
}
public class HowMany{
public static void main(String arges[]){
How a1 = new How();
System.out.println(a1.getValue());
How a2 = new How();
System.out.println(a2.getValue());
How a3 = new How();
System.out.println(a3.getValue());
}
}
标签:
原文地址:http://www.cnblogs.com/zczhtml/p/4892270.html