Java基础-static关键字 static关键字1、static修饰变量2、static修饰方法3、static修饰代码块4、静态导包1、static修饰变量对比:static变量属于类,通过类名调用,存放在内存区域中的方法区中。非static变量属于对象,通过对象的引用调用,存放在内存区域中的堆中。代码:public class Main { public static void main(String[] args) { System.out.println(Number.num1);