public class Diff
extends java.lang.Object
This file is based on http://introcs.cs.princeton.edu/96optimization/Diff.java, from 2011, see http://introcs.cs.princeton.edu/96optimization. A current copy may be found at http://introcs.cs.princeton.edu/java/23recursion/Diff.java.html
Constructor and Description |
---|
Diff() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
diff(java.lang.String aString,
java.lang.String bString)
Return the difference between two strings.
|
static void |
main(java.lang.String[] args)
Print the difference between two files.
|
public static java.lang.String diff(java.lang.String aString, java.lang.String bString)
aString
- The first string to be compared.bString
- The secondString to be comparedpublic static void main(java.lang.String[] args) throws java.net.MalformedURLException, java.io.IOException
Usage:
java -classpath $PTII ptolemy.util.test.Diff File1.txt File2.txt
args
- An array of two elements, where
the first element is the filename of the first
file and the second element is the filename of
the second file.java.net.MalformedURLException
- If a file name cannot be converted
into a URL.java.io.IOException
- If a file cannot be read.