The error is exactly what the compiler says - you have the last field, but nothing is set.
End fields must be assigned exactly once. You do not appoint him at all. We do not know which field is intended for presentation outside the documentation ("Standard initial password") - presumably there is some default password that you should know. You must assign this value to a field, for example.
public static final String INITIAL = "defaultpassword";
Optional: you do not need to write java.lang.String ; just use a short name ( String ). It is very rarely recommended that you use fully qualified names in your code; just import the types you use and keep in mind that everything in java.lang imported automatically.
Optional: do not compare strings with == ; use .equals instead .
Additionally: every time you have a code like this:
if (condition) { return true; } else { return false; }
you can simply write:
return condition;
For example, your acceptable method might be written as:
public boolean acceptable(String suggestion) { return suggestion.length() >= 6 && !suggestion.contains(" "); }
Jon skeet
source share