about | help | code help+videos | done | prefs |
Write the method called “longestWord”. This method receives a string and returns a word (String) from the given string that is the longest. Given: I Love Java – this would return Java. If there is more than one word as the "longest", then return the last "longest" word. We will assume the words are separated by just one space... No beginning space, but there will always be a space at the end. longestWord("I Love Java ") → "Java" longestWord("Math Is For Champions ") → "Champions" longestWord("What a good day ") → "good" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 100
Copyright Nick Parlante 2017 - privacy