- 1.<SPAN style="FONT-SIZE: medium"><SPAN style="FONT-SIZE: small"> class T1
- 2. {
- 3. static int t=1;
- 4. T1(int b)
- 5. {
- 6. t=b;
- 7. }
- 8. }
- 9. public class Static
- 10. {
- 11. T1 t1=new T1(2);
- 12. T1 t2=new T1(3);
- 13. T1 t3=new T1(4);
- 14. public Static()
- 15. {
- 16. System.out.println("t1: "+t1.t);
- 17. System.out.println("t2: "+t2.t);
- 18. System.out.println("t3: "+t3.t);
- 19. }
- 20. public static void main(String args[])
- 21. {
- 22. new Static();
- 23. }
- 24. }</SPAN></SPAN>
复制代码 |