I was able to complete the problem doing it in this manner, but I would assume there has to be an easier way.
Sample input:
abc, cba
Output:
Both strings of characters are equivalent.
Or
abc, acc
Output:
Different
import java.util.Scanner;
public class StringTest {
public static void main(String[] args) {
String str1, str2;
int aCount = 0, bCount = 0, cCount = 0, dCount = 0, eCount = 0, fCount = 0, gCount = 0, hCount = 0, iCount = 0, jCount = 0, kCount = 0, lCount = 0, mCount = 0, nCount = 0, oCount = 0, pCount = 0, qCount = 0, rCount = 0, sCount = 0, tCount = 0, uCount = 0, vCount = 0, wCount = 0, xCount = 0, yCount = 0, zCount = 0;
int aCount2 = 0, bCount2 = 0, cCount2 = 0, dCount2 = 0, eCount2 = 0, fCount2 = 0, gCount2 = 0, hCount2 = 0, iCount2 = 0, jCount2 = 0, kCount2 = 0, lCount2 = 0, mCount2 = 0, nCount2 = 0, oCount2 = 0, pCount2 = 0, qCount2 = 0, rCount2 = 0, sCount2 = 0, tCount2 = 0, uCount2 = 0, vCount2 = 0, wCount2 = 0, xCount2 = 0, yCount2 = 0, zCount2 = 0;
Scanner input = new Scanner(System.in);
System.out
.println("Enter your first string that you want compared (lowercase only):");
str1 = input.next();
str1 = str1.trim();
char[] charArr1 = str1.toCharArray();
System.out
.println("Enter your second string that you want compared (lowercase only):");
str2 = input.next();
str2 = str2.trim();
char[] charArr2 = str2.toCharArray();
input.close();
for (int i = 0; i < charArr1.length; i++) {
if (charArr1[i] == 'a')
aCount++;
if (charArr1[i] == 'b')
bCount++;
if (charArr1[i] == 'c')
cCount++;
if (charArr1[i] == 'd')
dCount++;
if (charArr1[i] == 'e')
eCount++;
if (charArr1[i] == 'f')
fCount++;
if (charArr1[i] == 'g')
gCount++;
if (charArr1[i] == 'h')
hCount++;
if (charArr1[i] == 'i')
iCount++;
if (charArr1[i] == 'j')
jCount++;
if (charArr1[i] == 'k')
kCount++;
if (charArr1[i] == 'l')
lCount++;
if (charArr1[i] == 'm')
mCount++;
if (charArr1[i] == 'n')
nCount++;
if (charArr1[i] == 'o')
oCount++;
if (charArr1[i] == 'p')
pCount++;
if (charArr1[i] == 'q')
qCount++;
if (charArr1[i] == 'r')
rCount++;
if (charArr1[i] == 's')
sCount++;
if (charArr1[i] == 't')
tCount++;
if (charArr1[i] == 'u')
uCount++;
if (charArr1[i] == 'v')
vCount++;
if (charArr1[i] == 'w')
wCount++;
if (charArr1[i] == 'x')
xCount++;
if (charArr1[i] == 'y')
yCount++;
if (charArr1[i] == 'z')
zCount++;
}
for (int i = 0; i < charArr2.length; i++) {
if (charArr2[i] == 'a')
aCount2++;
if (charArr2[i] == 'b')
bCount2++;
if (charArr2[i] == 'c')
cCount2++;
if (charArr2[i] == 'd')
dCount2++;
if (charArr2[i] == 'e')
eCount2++;
if (charArr2[i] == 'f')
fCount2++;
if (charArr2[i] == 'g')
gCount2++;
if (charArr2[i] == 'h')
hCount2++;
if (charArr2[i] == 'i')
iCount2++;
if (charArr2[i] == 'j')
jCount2++;
if (charArr2[i] == 'k')
kCount2++;
if (charArr2[i] == 'l')
lCount2++;
if (charArr2[i] == 'm')
mCount2++;
if (charArr2[i] == 'n')
nCount2++;
if (charArr2[i] == 'o')
oCount2++;
if (charArr2[i] == 'p')
pCount2++;
if (charArr2[i] == 'q')
qCount2++;
if (charArr2[i] == 'r')
rCount2++;
if (charArr2[i] == 's')
sCount2++;
if (charArr2[i] == 't')
tCount2++;
if (charArr2[i] == 'u')
uCount2++;
if (charArr2[i] == 'v')
vCount2++;
if (charArr2[i] == 'w')
wCount2++;
if (charArr2[i] == 'x')
xCount2++;
if (charArr2[i] == 'y')
yCount2++;
if (charArr2[i] == 'z')
zCount2++;
}
if (aCount == aCount2 && bCount == bCount2 && cCount == cCount2
&& dCount == dCount2 && eCount == eCount2 && fCount == fCount2
&& gCount == gCount2 && hCount == hCount2 && iCount == iCount2
&& jCount == jCount2 && kCount == kCount2 && lCount == lCount2
&& mCount == mCount2 && nCount == nCount2 && oCount == oCount2
&& pCount == pCount2 && qCount == qCount2 && rCount == rCount2
&& sCount == sCount2 && tCount == tCount2 && uCount == uCount2
&& vCount == vCount2 && wCount == wCount2 && xCount == xCount2
&& yCount == yCount2 && zCount == zCount2)
System.out.println("Both strings of characters are equivilent.");
else
System.out.println("Different");
}
}