


The next word is optional and describes when the method can be used. The first word describes who can use the method, and since this is the main method it must be available for everyone to use so it says "public." These words describe specific attributes of the method. In front of the main method's name are three words. Since there are no instructions within main right now, running the program will cause nothing to happen. This is because when a java program is run it the first thing a computer looks for is a method named "main" and follows out all the instructions within that method. When a class contains a "main" method it allows a program to be executed. The "main" method of a class is quite literally the main instruction of a program. What we just wrote is the "main" instruction, or method, of our program. Your program should now look like the picture.

Inside your file type "class MyFirstProgram ".ģ. The newly created interface should appear in the Package Explorer view and a java editor instance that allows you to modify the new interface should appear in the editor area.1. Select the Generate comments check box if you like comments to be generated. Once the java interface wizard comes up −Įnsure the source folder and package are correct.Ĭlick on the Add button to select the extended interfaces. Right clicking in the package explorer and selecting New > Interface.Ĭlicking on the class drop down button ( ) in the tool bar and selecting Interface ( ).īefore bringing up the New Java Interface wizard, if possible, select the package in which the interface is to be created so that the wizard can automatically fill in the package name for you. There are many ways of opening this wizard −Ĭlicking on the File menu and selecting New → Interface. The New Java Interface wizard can be used to create a new java interface.
