0

WHAT IS WRONG?
public class Person {
String name;
public Person (String personName) {
name = personName;
}
public String greet (String yourName ) {
return String.format ("Hi %s, my name is %s" + name+yourName);
}
}

Comments
  • 2
    They should also be the other way around - String.format("Hi %s, my name is %s", yourName, name);
  • 0
    guys why they should be comma seperated??
  • 0
    The signature of the method is String.format(Strimg format, Object... args). The variables to insert into the String are separate arguments to the method, in the order that you want them to be inserted. Take a look here for more info http://tutorialspoint.com/java/...
Add Comment