为什么我eclips数组显示的都是乱码,怎么解!

为什么我eclips数组显示的都是乱码,怎么解!

乱码内容是:[I@7d4991ad[I@7d4991ad  [I@7d4991ad  [I@7d4991ad  [I@7d4991ad  [I@7d4991ad  [I@7d4991ad  [I@7d4991ad  [I@7d4991ad  [I@7d4991ad

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

3回答
没有马甲线的安琪拉 2017-10-03 17:42:31
1
2
3
for(int a:i) {
    System.out.print(a);         
}

你把输出语句中的i调整为a就可以了

提问者 正方向Sid007 2017-10-03 14:53:40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package test;
 
public class Arry112 {
 
    public static void main(String[] args) {
        int[] i;
        i=new int[10];
        for(int a:i) {
            System.out.print(i);
             
        }
        System.out.println();
         
 
    }
 
}


喜欢做梦的鱼 2017-10-03 11:18:30

建议把代码贴出来以便于帮助查找问题~~

  • 提问者 正方向Sid007 #1
    package test; public class Arry112 { public static void main(String[] args) { int[] i; i=new int[10]; for(int a:i) { System.out.print(i); }System.out.println(); } }
    2017-10-03 14:52:52
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师
插入代码