Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

How to design a Java program that reads a sentence, say s, consisting of lower-case words with .nextLine() method, identifies the words using...

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)     sort the words in s in the alphabetical order. they will be rearranged to (Use .comparedTo() method.)

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question