How to design a Java program that reads a sentence, say s, consisting of lower-case words with .nextLine() method, identifies the words using .indexOf() and .substring() methods and saves them in String variables. Then the program will perform the following two operations:
a) Find the longest word When there are multiple longest words print the first one.
b) Sorrt the words in s in the alphabetical order. they will be rearranged to (Use .comparedTo() method.)