Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

Problem in using java arraylist getting ArrayStoreException?

$
0
0
List<Integer>list[]=new ArrayList[2];
list[0]=Arrays.asList(new Integer[]{1,2,3});
System.out.println(list[0]);

CONSOLE LOG

Exception in thread "main" java.lang.ArrayStoreException: java.util.Arrays$ArrayList
at problems.codechef.Experiment.main(Experiment.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

Can anyone tell me what is the bug in this code.


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>