This is for an assignment in data structures and I can't seem to find the exact answer I need.
I am attempting to take user input for a date, preferably YY-MM-DD format, then check for validity.. if not valid, cycling until valid. This really seems very tedious and I am receiving two illegal start of expression errors.
I did search, google and stackoverflow, but only find things addressing Date
public String hireDate(){
Scaer input = new Scaer(System.in);
boolean answer = false;
while(answer == false){
String temp = input.nextLine();
if((temp.charAt(0) >= 0 && temp.charAt(0) <= 9) && (temp.charAt(1)
>= 0 && temp.charAt(1) <= 9) && (temp.charAt(2) == -)
&& (temp.charAt(3) >= 0 && temp.charAt(3) <= 9) && (temp.charAt(4)
>= 0 && temp.charAt(4) <= 9) && (temp.charAt(5) == -)
&& (temp.charAt(6) >= 0 && temp.charAt(6) <= 9)){
answer = true;
}
else {
answer = false;
}
}retu temp;
}
