Java tutorial
//package com.java2s; public class Main { /** * Print a message to System.out * but also identify which thread is saying the message * @param message - The message to post. */ private static void threadMessage(String message) { String threadName = Thread.currentThread().getName(); System.out.format("%s: %s%n", threadName, message); } }