public class SleepMessages {
  //Display a message, preceded by the name of the current thread
  static void threadMessage(String message) {
    String threadName = Thread.currentThread().getName();
    System.out.format("%s: %s%n", threadName, message);
  }
  public static void main(String args[]) throws InterruptedException {
    String importantInfo[] = {
      "Boi, boi, boi...",
      "Boi da cara preta,",
      "Pega este menino...",
      "Que tem medo de careta."
    };
    for (int i = 0; i < importantInfo.length; i++) {
      //Pause for 2 seconds
      Thread.sleep(2000);
      //Print a message
      threadMessage(importantInfo[i]);
    }
  }
}
