You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throws the exception java.lang.ArrayStoreException:
[error] (run-main-8) java.lang.ArrayStoreException: [Ljava.lang.Object;
java.lang.ArrayStoreException: [Ljava.lang.Object;
at scala.runtime.ScalaRunTime$.array_update(ScalaRunTime.scala:89)
at Program$.test(Program.scala:8)
at Program$.main(Program.scala:12)
at Program.main(Program.scala)
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:497)
The output of the program
class [[Lscala.runtime.Nothing$;
class [Ljava.lang.Object;
explains the problem. The array arr created using ClassTag has element type Array[scala.runtime.Nothing$] but array created by new has type Array[java.lang.Object].
Same exception is thrown with Null. For other types it works fine.
The text was updated successfully, but these errors were encountered:
The following program
throws the exception java.lang.ArrayStoreException:
The output of the program
explains the problem. The array arr created using ClassTag has element type Array[scala.runtime.Nothing$] but array created by new has type Array[java.lang.Object].
Same exception is thrown with Null. For other types it works fine.
The text was updated successfully, but these errors were encountered: