![]() |
Help: Your First Java Application With VisualAge
Help is available for each task, or you can go straight to the solution source code.
![]() No help for this task. Task 2Create a new class in the HelloWorld project by clicking on the "create new class" icon (the icon under the menu bar that as the letter "C" on it). Type "HelloWorld" into the text field to the right of "Class Name". Click the "Next" button. VisualAge will warn you that no package exists for this class. Click "Continue" to force it to make a default package for you. The next dialog box asks questions about what classes and interfaces your new class will need. Simply click "Next". The final dialog box asks about what interfaces your new class will implement. Simply click "Finish" to create your new class. Your workbench will contain should the HelloWorld class in the HelloWorld project and should resemble:
![]() The serious of dialogs during class creation should look like:
![]()
![]()
![]() Task 3Create a main method by clicking on the "create method or constructor" icon under the menu bar (the icon has the letter "M"). From the drop down list, select "main Method". The dialog should look like:
![]() Click "Finish". No help for this task. Task 4Instruct the main method to print "Hello World!" to standard out by adding:System.out.println("Hello World!");after the "{", but before the return statement. Your workbench should look like the following:
![]() Using the popup menu (right mouse click), select "Save", which instructs VisualAge to incorporate your changes. No help for this task. Task 5Select the HelloWorld class above the main method in the workbench upper pane (the class should have a very small icon representing a person running). Next, click on the larger icon of a person running underneath the toolbar to run your program. VisualAge gives you a dialog box asking for command-line parameters to pass to the application (these are analogous to argc and argv in C/C++). Click "Run". VisualAge will bring up the console and in the standard output pane, you should see the output "Hello World!".No help for this task. |
Copyright © 1996-1997 MageLang Institute. All Rights Reserved. |