我写了以下函数:
public void enterlessonnames(String[] names)
{
String msg="";
for (int i=0;i<names.length;i++)
{
msg=msg+names[i];
}
System.out.println(msg);
}
我想这样打电话,给出输入:
enterlessonnames({"math","art"} );
我怎么能把它叫做主要?
enterlessonnames(names[{"math","art"} ]);
它没有任何一个。
Multiple markers at this line:
- Syntax error, insert ")" to complete MethodInvocation
- Syntax error on token ",", delete this token
- Syntax error, insert ";" to complete Statement
- Syntax error on tokens, delete these tokens