Eli's Section Notes
Section #2 (T 2:30-3:20pm) and Section #3 (T 3:35pm-4:25pm), both in Hollister 312
1. How to Use Java through the Command Line
2. Induction Examples from various sources
3. Suggested List Review
HOW TO USE JAVA THROUGH THE COMMAND LINE
Find where in the directory structure javac.exe is (i.e. the folder it's in). At the DOS prompt type
path
and hit enter. This is a list of where your computer checks for programs when you say to run them. You want to add the f\
older containing javac.exe to this list. Do so by typing at the DOS prompt
(replace the text within the double quotations with your relevant directory, the
following works for the CIT computers in Upson)
path %path%;"c:\Program Files\jdk1.3.1_03\bin"
and hit enter. Check the path again to see if it is added to the list.
If this interests you, look at www3.sympatico.ca/rhwatson/dos7/z-path.html
If that doesn't work here's a way around it:
From the command prompt change into the directory that contains javac.exe. You can do a search to determine which folder \
that is. You can change directories in the DOS prompt with the command "cd", used as follows:
//this line brings you up one level, to C:\WINDOWS
C:\WINDOWS\Desktop>cd ..
//this line will bring you to the Desktop subdirectory of WINDOWS
C:\WINDOWS>cd Desktop
Once in the directory containing javac you can call it from the command line. You can reference your *.java files in any \
of the following ways:
//if your file is in the same directory
>javac myfile.java
//if your file is in a subdirectory
>javac foldername/myfile.java
//if your file is in the parent directory (up one level)
>javac ../myfile.java
//if your file is far away in the directory structure
>javac c:\cs211hw\myfile.java
SUGGESTED LIST REVIEW
class ListItem {
ListItem next;
Object data;
}
Add the following functionality to the above class:
- search through the list (of int's) for the max and min values.
- search through the list (of int's) and count the number of odd values.
- search through the list (of int's) and count the number of consecutive numbers (numerically) that appear consecutively (in the list).