Java中set和get
public class HelloWorld { String name; String sex; int score; int age; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public int getScore() { return score; } public void setScore(int score) { this.score = score; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public static void main(String[] args) { HelloWorld hello = new HelloWorld(); hello.setName("imooc"); hello.setSex("Male"); hello.setAge(10); hello.setScore(98); hello.getName(); hello.getSex(); hello.getAge(); hello.getScore(); } }
请问一下我写的代码为什么不能输出?