Here is my code:
private String studentId;
public void setStudentId(String studentId) {
if (studentId != null && studentId.trim().length() > 0 && studentId != " ") {
if (studentId.charAt(0) = 'a') {
this.name = studentId;
}
} else {
System.out.println("Error. Not Valid.");
}
}
I'm getting this error:
"Unexpected type, required : variable, found : value".
I'm supposed to make sure if the first letter of the the passed String is equal to 'A' or not. If anyone can help me to fix this, I would appreciate it.
Also, if there are any other mistakes in my code I would be happy to be informed.