// Import necessary classes import java.lang.Runnable; import java.lang.Thread; // HelloWorldRunnable class implementing the Runnable interface public class HelloWorldRunnable implements Runnable { @Override public void run() { // Code executed when the thread runs System.out.println("Hello, World from a Runnable!"); } public static void main(String[] args) { // Create a new instance of a Thread with HelloWorldRunnable Thread myThread = new Thread(new HelloWorldRunnable()); // Start the thread myThread.start(); } }