想问一下我的哪里错了
public class HelloWorld {
String name; // 声明变量name
String sex; // 声明变量sex
static int age;// 声明静态变量age
public HelloWorld () {
System.out.println("通过构造方法初始化name");
name = "tom";
}
{
System.out.println("通过初始化块初始化sex");
sex = "男";
}
static {
System.out.println("通过静态初始化块初始化age");
age = 20;
}
public void show() {
System.out.println("姓名:" + name + ",性别:" + sex + ",年龄:" + age);
}
public static void main(String[] args) {
HelloWorld hello = new HelloWorld();
Hello.show();
}
}