public static void main(String[] args) { person c1 = new person(); c1.name = "王海燕"; c1.setage(18); System.out.println(c1.getage()); }}class person{ String name; private int age; public void setage(int a){ if(a > 0 && a < 150) age = a; else System.out.println("no"); } public int getage(){ return age; } /* public void speak(){ System.out.println(name + "..." +age); }*/}