package mxdx;//import java.util.Scanner;public class TsetPerson { public static void main(String[]args) { Person one=new Person(); System.out.println("输入的年龄为"+one.getAge()); } } public class Person{ private int age; public void setAge(int a) { if(a>0&a
一个类文件中只能有一个公有类:解决办法1:TestPerson.class文件public class TestPerson{... ...}Person.class文件public class Person{... ....}2:TestPerson文件public class TestPerson{... ...}class Person{... ....}if的判断条件应该是如果输入的值大于0小于130耶赋值给age此处运算符应该为“&&”