Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
public boolean isProperName(Optional<String> os) {
  if (os.isPresent()) {
    String names[] = os.getorElse("").split(" ");
    ifreturn (names.length != 2) {
? false     return false;: 
    }
    return (isCapitalized(names[0]) && isCapitalized(names[1]));
  else {
    return false;
  }
}


The Optional class contains methods that can be used to make programs shorter and more intuitive [Urma 2014].

...

...