I have to wrtie a program for class that asks the user to input to cards ex: 7c(7 of clubs) and then compare the two cards at the end to see which one is the greater card. This is the code I have so far and for some reason it does not want to compile for the first card entry. Please help!
public class Program2
{
public static void main(String[] args)
{
String str1;
System.out.println("Please enter first card: ");
str1 = SavitchIn.readLine();
len1 = str1.length();
if (len1==3)
{
char1a=str1.charAt(0);
char1b=str2.charAt(1);
char1c=str3.charAt(2);
}
else if (len1==2)
{
char1a=str1.charAt(0);
char1b=str2.charAt(1);
}
else
{
System.out.println("Error");
}
}
}