Is there a way to include a simple if statement inside a Java String passed as argument to a function, like the following example
int TotalFiles = 3;
JOptionPane.showMessageDialog(frame,
"Created " + TotalFiles + " file" + (if(TotalFiles>1){"s"}) + ".");
Aucun commentaire:
Enregistrer un commentaire