0

它无法识别item[1]我猜这是因为该方法被声明为public static void main(STRING[] args). 但是我应该如何声明主要方法才能让整数被接受?

这是 Eclips 提出的信息:Exception in thread "main" java.lang.ArrayStoreException: [Ljava.lang.Integer; at Package1.test7.main(test7.java:18)


// import java.util.arrays;

public class test7

{    



    public static void main(String[] args)
    {

    Object[][] items = new String[2][]; 
    items[0] = new String[]{"a", "b"}; 
(18)items[1] = new Integer[]{1, 2, 4}; 


    System.out.println (items[0]);

    }   

}


4

0 回答 0