Value as a string from a void function

so buffer it:

String thisOne = "";


void displayinformation(){
  if (selection.equals("1")) {
    thisOne = information("John", 30);
  }
  if (selection.equals("2")) {
    thisOne = information("Melanie", 40);
  } 
}

//....
myMessage.add(thisOne);
1 Like