QAQQAQAQQQAQQAQQAQAQ
1 import java.util.ArrayList; 2 import java.util.Iterator; 3 class myclass{ 4 int num=233; 5 static int num_static=666; 6 7 public void method() { 8 System.out.println(num); 9 System.out.println(num_static); 10 System.out.println("这是一个成员方法"); 11 } 12 public static void method_static() { 13 //System.out.println(num); 14 System.out.println(num_static); 15 System.out.println("这是一个静态方法"); 16 } 17 } 18 public class Main{ 19 public static void main(String[] args) { 20 myclass obj = new myclass(); 21 obj.method(); 22 obj.method_static(); 23 myclass.method_static(); 24 System.out.println(" "); 25 } 26 }
原文:https://www.cnblogs.com/pengge666/p/11991653.html