fork download
  1. public String formatName(String firstName, String lastName) {
  2. if (firstName != null && lastName != null){
  3. return lastName + ', ' + firstName;
  4. }
  5. return lastName + firstName;
  6. }
Success #stdin #stdout #stderr 0.02s 9988KB
stdin
Standard input is empty
stdout
Object: nil error: did not understand #String
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject(Object)>>doesNotUnderstand: #String (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
Object: String error: did not understand #firstName
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
String class(Object)>>doesNotUnderstand: #firstName (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:2: parse error, expected '}'
./prog:2: expected expression
./prog:2: expected expression