Simple Java question 5

Write a Java method named sentenceType that accepts a single String parameter named s and returns a String that indicates whether the actual argument passed was declarative, exclamatory, or interrogative — according to whether the last character in s is a period (.) , an exclamation mark (!), or a question mark (?).
Your method should return the message bad ending if the last character is none of these punctuation marks. You must create a method that has return type String, it's not enough to just print the sentence type in the method.Attachments