【发布时间】:2016-05-28 01:29:53
【问题描述】:
package age;
import java.util.Scanner;
public class AgeTest
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
Age myAge = new Age();
System.out.printf("initial age is :%s%n%n"+ myAge.getAge());
System.out.println("PLEASE ENTER THE AGE");
int theAge = input.nextInt();
myAge.setAge(theAge);
System.out.println();
// display the name stored in object myAge
System.out.printf("age in object myAge is %n%s%n"+ myAge.getAge());
怎么了?
【问题讨论】:
-
错误信息已经够清楚了。你有什么不明白的?
-
这是我第一次使用 java :)