.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]);
點擊展開后面1條
添加回答
舉報
0/150
提交
取消