在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]

mvel2怎么将数组转成字符串打印

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

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