Value as a string from a void function

in that case it makes no sense to remember it as a string, like i suggested last time.

String thisOne = "";
String thisName = "";
int thisAge=0;

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

  } 
}

//....
thisOne = information(thisName,thisAge);
myMessage.add(thisOne);


//... draw
if ( thisAge > 40 ) { .. }
1 Like