I wrote the following function:
public void enterlessonnames(String[] names)
{
String msg="";
for (int i=0;i<names.length;i++)
{
msg=msg+names[i];
}
System.out.println(msg);
}
I want to call like that, giving the input:
enterlessonnames({"math","art"} );
How can i call this in main?
enterlessonnames(names[{"math","art"} ]);
It does not any of them.
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
enterlessonnames(isimler[{"math","art"} ]);
What do you expect to happen here? Could you provide the code for the methodisimler
? – reto Jul 18 '13 at 9:13