How can I get this to work? It's Java
Go to solution
Solved by MrSuperb,
class test
{
public static String method (String arg)
{
switch(arg){
case "hello":
return "hello";
case "goodbye":
return "goodbye";
default:
return "Error";
}
}
public static void main(String[] args)
{
System.out.println(method("hello") + method("goodbye"));
}
}

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now