I am supposed to create a method in a different class that takes a string input and: "validate that a String represents 8 symbols, including letters (upper and lower case), numbers, and special symbols like #$&_."
This is my code so far.
public static boolean validSSN(String SSN)
{
    int length = SSN.length();
    boolean flag = false;
    if(length == 11)
    {
        if(SSN.matches("^\\d{3}[-]{1}\\d{2}[-]{1}\\d{4}")) flag = true;
    }
    return flag;
}
 
    