// This file defines the "main" method, within a class called "MainMethod". // It's ok to change the name "MainMethod". (You would have to also // rename the MainMethod.java file.) // // The name "main" should not be changed. When a java program is run, // execution begins at the "main" method. An error occurs if there are no // methods (or several methods) named "main". // This program uses class "MyThread", which is defined in file MyThread.java public class MainMethod { // Here is the definition of the method "main". You don't have to worry // about the meaning of "public static void" and "String argv[]". public static void main (String argv[]) { MyThread P; // P can hold an instance of class MyThread P = new MyThread("Venus"); // create a new instance of MyThread P.start(); P = new MyThread("Mars"); // create a new instance of MyThread P.start(); System.out.println("This is main speaking"); } // end of "main" } // end of "MainMethod"