| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2112 人关注过本帖
标题:学数据初始化程序老是出错。需要修改哪里》?以附代码。
取消只看楼主 加入收藏
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
快速回复:学数据初始化程序老是出错。需要修改哪里》?以附代码。
数据加载中...
 
   



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

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