These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

JAVA01/Check If Command Line Arguments Are Equal

Classnotes | JAVA01 | RecentChanges | Preferences

Write a program that takes two command line arguments and compares them if they are equal. Call the program "Equals.java".

If I were to run the program thusly:

 C:\> java Equals sam bob

I should get the following result:

 'sam' and 'bob' are the same?
 Answer: false

Or like this:

 C:\> java Equals sam sam

I get this

 'sam' and 'sam' are the same?
 Answer: true


Classnotes | JAVA01 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited May 29, 2003 12:40 am (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.