MVEL2 数组转字符串打印方法
在 MVEL2 中,可以使用 'Arrays.toString()' 方法将数组转换为字符串,并使用 'System.out.println()' 方法打印出来。以下是示例代码:
import org.mvel2.MVEL;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
int[] arr = {1, 2, 3, 4, 5};
String arrString = Arrays.toString(arr);
System.out.println(arrString);
}
}
输出结果为: '[1, 2, 3, 4, 5]'
原文地址: https://www.cveoy.top/t/topic/fLdb 著作权归作者所有。请勿转载和采集!