我想回調一個if-else語句的這個方法,但是我總是收到諸如「.class is expected」之類的錯誤。調用方法的錯誤
這裏是我的代碼:
public static void display(String[] date,int index,int arraylength)
{
for (index=0;index<arraylength;index++)
{
System.out.println("The date ["+index+"]: "+date[index]);
}
//this is the method which is for display an array element
if (pass.equals("BERKAT123"))
{
display(String[] date;int index;int arraylength);
}
else
{
System.out.println("Incorrect password");
start();
}
}
//this is where the method will be call...
好像我搞砸了的參數。有人能告訴我如何編寫正確的參數嗎?
更新你的錯誤也 –
」的.class'預期 顯示器(的String []日期; INT指數; INT arraylength) ; – Derpington
直接傳遞值如顯示(日期,索引arraylength) –