Computing Concepts with Java 2 Essentials - Help. Blue. J is a free Java environment available from. Monash University. Blue. J requires a. Java 2 runtime, so you need to install the JDK first before installing. Blue. J. Blue. J is written in Java and runs on any platform with a Java 2. Linux, Solaris, Windows, or Mac OS X. Blue. J is a wonderful environment that makes you think about objects and. It also contains an excellent, easy to learn. You can use Blue. J to run regular Java programs, but to make the. This is. different from the way that the book code is distributed, with one. Simply make a new subdirectory every time you. To start Blue. J, open a command shell and type a command such as cd \bluejbluej. Teaching Java with the BlueJ Environment Dianne Hagan School of Computer Science and Software Engineering Monash University, AUSTRALIA [email protected].This web page contains the java example programs that will be covered in class. A couple of new basic programs will be added each semester. One new Civil Engineering. Compiling and running Java programs with BlueJ. Successfully compiled files program files in BlueJ. On Linux/Unix, enter a command such as cd /usr/local/bluej./bluej. The details depend on your software installation. Then select Package - > Open Non Blue. J from the menu. select the subdirectory. Caution: You want to select that. Highlight the directory name and. To. run an application, right- click on the class with the main. To run an applet, right- click on the applet. To instantiate an object, right- click on the class and select an. The object is created on the . To investigate the object, right- click on it and start. For example, see the Blue. J version of Hello. You can simply download a zip file with all. Blue. J. Below you will find the rationale behind the conversions. Chapter 1. Hello. Change the program to. Hello. You. get the Blue. J equivalent of the . Simply select the menu option Tools- > Call library class. Type in java. awt. Rectangle and hit the ENTER key. Then pick a constructor. Now instantiate a. Rectangle with construction parameters 5, 1. An object appears on the workbench. Call get. X. get. Writing Java Programs using BlueJ Suppose you want to store your Java projects under the directory C:\CSC211. BlueJ COMPANION MANUAL To accompany Big Java 2e and Java Concepts 4e by Cay Horstmann BRUCE QUIG, Deakin University Based on the BlueJ Tutorial by Michael K You can use BlueJ to simply compile and run all examples in the. Y, get. Width, get. Height to see the. Chapter 2. Coins. Coins. 2. java, Volume. Make. Password. java: Simply. Total. get. Volume, get. Password method. public class Coins. Instead. use two methods get. Dollar and get. Cents. Note that. the constants now need class scope (static final). Simply turn the inputs into. Total method and then supply them when. Chapter 3. Bank. Account. Test. java: Remove the test driver program and simply. Bank. Account class in Blue. J. This is a perfect. Blue. J effectively. Students can instantiate some. Coins. 6. java: Put the Purse and Coin class into. Purse. java and Coin. Discard the test program. To run an applet, simply right- click on the class file and choose. If you like, keep the. Table. java: Change main to void print()Average. Sentinel. java, Sentinel. Words. java, Split. These programs are about processing input. Execute them from the. Blue. J. Reverse. Change main to String reverse(String s). Here is the program, with the line numbers. Prime. Bug // 1 . Investigate the classes with Blue. J. Chapter 1. 0Mouse. Spy. Applet. java: Unfortunately, Blue. J does not show System. You can either run the applet viewer. The frame window. Blue. J frame). Bring it to the front and click on it. It would make sense to leave the. Note that the call to show must. Remove the main method. Split the program into multiple files, one for. Chapter 1. 1Best. Price. java, Best. Data. java, Best. Product. java: This is another good. Blue. J makes you write a more object- oriented program. Remove. 1. java, Remove. Insert. java: Make classes with add. Polygon. Test. java, Cloud. Test. java: Move each class in a separate file. Table. 2. java: Make the two- dimensional array into an instance. Table. into a non- static method. Chapter 1. 2Move the calls to set. Title and show inside the frame. Note that the call to show must be the last line of. Remove the main method and the window closer. Note that the call to show must. Remove the main method. Crypt. java: Reorganize the program so that the encrypt. File. method takes String parameters for the file names and a boolean. For clarity, the main. Note how this setup more clearly separates the. Database. java: This program was a port of a very un- object- oriented. C++ program. Reorganizing it to fit Blue. J greatly improved the. Now Database is a class, and the only static. Fixed. String/write. Fixed. String. utility methods. We left the main method in place so you can. Note again how this clearly demonstrates the. Blue. J—it forces you to think of the separation. Chapter 1. 4Invoice. Test. java: Break up into one class per file. ATMSimulation. java: Break up into one class per file and handle the. Chapter 1. 5The biggest problem is that you can't put the int. Conceptually, that is unfortunate because after all arrays are. To overcome that, I made wrappers Int. Array and String.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |