java中的全局变量、局部变量与静态常量的区别 java中的变量类型分类:类变量:独⽴于⽅法之外的变量,⽤ static 修饰。实例变量:独⽴于⽅法之外的变量,不过没有 static 修饰。局部变量:类的⽅法中的变量。⽐如:public class Variable{ static int allClicks=0; // 类变量 String str="hello world...