标题:学数据初始化程序老是出错。需要修改哪里》?以附代码。
取消只看楼主
Eeiou
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-11-27
结帖率:0
 问题点数:0 回复次数:0 
学数据初始化程序老是出错。需要修改哪里》?以附代码。
public class ArrayDefaultValue {                                       
    public static void main(String args[])
    {
        byte[]byteArray=new byte[1];
        char[]charArray=new char[1];
        int[]intArray=new int[1];
        long []longArray= new long[1];
        float []floatArray=new float[1];
        double []doubleArray=new double[1];
        String[]stringArray=new String[1];
        System.out.println("byte+"byteArray[0]);
        System.out.println("char+"charArray[0]);
        System.out.println("int+"intArray[0]);
        System.out.println("long+"longArray[0]);
        System.out.println("float+"floatArray[0]);
        System.out.println("double+"doubleArray[0]);
        System.out.println("string+"stringArray[0]);
    }   

}
运行结果。这是什么意思?
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    The type of the expression must be an array type but it resolved to String
    Syntax error on token "byteArray", delete this token
    The type of the expression must be an array type but it resolved to String
    Syntax error on token "charArray", delete this token
    The type of the expression must be an array type but it resolved to String
    Syntax error on token "intArray", delete this token
    The type of the expression must be an array type but it resolved to String
    Syntax error on token "longArray", delete this token
    The type of the expression must be an array type but it resolved to String
    Syntax error on token "floatArray", delete this token
    The type of the expression must be an array type but it resolved to String
    Syntax error on token "doubleArray", delete this token
    The type of the expression must be an array type but it resolved to String
    Syntax error on token "stringArray", delete this token

    at ArrayDefaultValue.main(ArrayDefaultValue.java:12)
搜索更多相关主题的帖子: double public 
2015-12-08 14:53



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-460006-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.798371 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved