fork download
  1. import java.util.*;
  2. import java.text.MessageFormat;
  3.  
  4. class Ideone
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8.  
  9. String playerName = "João";
  10. String playerType = "MODERADOR";
  11. String gameType = "pvp";
  12. int messages = 10;
  13.  
  14. String output = MessageFormat.format("[{0}] {1} [{2}] > {3} mensagens.",
  15. playerType, playerName, gameType, messages);
  16.  
  17. System.out.println(output);
  18. }
  19. }
Success #stdin #stdout 0.06s 711680KB
stdin
Standard input is empty
stdout
[MODERADOR] João [pvp] > 10 mensagens.