.jsp文件里<jsp:useBean class="com.gds.rule.Test1" id="test123" scope="page" /><%int arr[] = test123.getarr(1,2,3,4,5,6,7,8);out.print(arr);%>.java文件里public class Test1 extends com.gds.kernal.DBconn { public int getarr(int a[]) { return a[3];}错误:The method getarr(int[]) in the type Test1 is not applicable for the arguments (int, int, int, int, int, int, int, int)。应该怎么传
2 回答
__innocence
TA贡献313条经验 获得超208个赞
int arr[] = test123.getarr(1,2,3,4,5,6,7,8);
Java代码里面传的参数是数组,所以,把上面一句话改成:
int arr[] = test123.getarr([1,2,3,4,5,6,7,8]);
添加回答
举报
0/150
提交
取消