Ad
  • Custom User Avatar

    both branches of a ternary operator must have the same type. if you remove "" + , the left branch has type char while the right branch has type String, so it does not compile:

    error: incompatible types: bad type in conditional expression
    char cannot be converted to String
    
  • Custom User Avatar

    Why do you have "" in the beging of your conditional return statment?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution