title: Why am I getting an incompatible types error when trying to see if a String ends with a specific character?
body: <p>I'm working on a dinky code for java, in which I have to create a program that: 1) capitalizes the first word of the input sentence, 2) capitalizes the word "I", and 3)punctuates the sentence if there is no proper punctuation. I wrote the code easily, but it's a bit messy. Specifically, I was wondering how you would use a special character for a conditional.</p>
  
  <p>for example,</p>
  
  <pre><code>String sentence = IO.readString(); /* IO.readstring is irrelevant here, it's just a           scanning class that reads a user input*/
  int length = sentence.length();
  char punctuation = sentence.charAt(length - 1);
  if (punctuation != "." || punctuation != "?" || punctuation != "!")
      {
          sentence = sentence + ".";
      }
  </code></pre>
  
  <p>this is giving me an incompatible types error when I try to compile it (incompatible types : char and java.lang.string)</p>
  
  <p>How would I go about writing this conditional?</p>