• 2021-04-14 问题

    分析下面的程序,写出运行结果。classExercises6_3{classDog{privateStringname;privateintage;publicintstep;Dog(Strings,inta){name=s;age=a;step=0;}publicvoidrun(Dogfast){fast.step++;}}publicstaticvoidmain(Stringargs[]){Exercises6_3a=newExercises6_3();Dogd=a.newDog("Tom",3);d.step=29;d.run(d);System.out.println(""+d.step);}}运行结果是:()

    分析下面的程序,写出运行结果。classExercises6_3{classDog{privateStringname;privateintage;publicintstep;Dog(Strings,inta){name=s;age=a;step=0;}publicvoidrun(Dogfast){fast.step++;}}publicstaticvoidmain(Stringargs[]){Exercises6_3a=newExercises6_3();Dogd=a.newDog("Tom",3);d.step=29;d.run(d);System.out.println(""+d.step);}}运行结果是:()

  • 1