This error occurs when you try to cast an object of type Integer to an array of objects (Object[]).

For example:

Integer i = 10;
Object[] arr = (Object[]) i;

To fix this error, you need to create a new array and add the Integer object to it:

Integer i = 10;
Object[] arr = new Object[1];
arr[0] = i;
javalangInteger cannot be cast to LjavalangObject;

原文地址: https://www.cveoy.top/t/topic/bq4Q 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录