问答详情
源自:12-1 综合练习

小白白求助

我想得到的是序号1后面加奥迪选项,序号2后面加马自达,后面也是一样,可是我输出的却是循环的,大神们,怎么改呢?

http://static.mukewang.com/img/59aa1f870001a7b513660768.jpg

http://static.mukewang.com/img/59aa1f8800014d3713660768.jpg

http://static.mukewang.com/img/59aa1f880001d69913660768.jpg

http://static.mukewang.com/img/59aa1f8a00018f5513660768.jpg

http://static.mukewang.com/img/59aa1f8a0001a80e13660768.jpg


提问者:慕桂英0739128 2017-09-02 11:04

个回答

  • 忆往昔212
    2017-09-02 16:35:07
    已采纳

    不需要for循环,将for循环体整体替换如下:

    int i =1;
    System.out.print(""+i);
    Aodi show = new Aodi();
    show.ren();
    i++;
    System.out.print(""+i);
    Mazida show1 = new Mazida();
    show1.ren();

    这样应该可以实现你要的效果。望采纳!