class Hello{ String name="12"; int age; public static void main(String[] args){ Hello hello = new Hello(); System.out.println(hello.name); } }
class Hello{ static String name="12"; int age; public static void main(String[] args){ System.out.println(name); } }都是在class中的,static就不用new