Question: Please help me code the following in: JAVA Please create the code in as basic way as possible, so I can understand it better :)
Please help me code the following in: JAVA
Please create the code in as basic way as possible, so I can understand it better :)
Full points will be awarded, thanks in advance! 
2. Finding the Lexicographic or by Length Largest String 2.1 Write a method called lexLargest that takes a string object argument containing some text. Your method should return the lexicographical largest word in the String object (that is, the one that would appear latest in the dictionary). String large-lexlargest ("I am the very model of a modern major general"); System.out.printin(large); I/ should print : very 2.2 Write a method called largestBy that takes a string object argument containing some text. Your method should return the largest-by-length word in the String object. In case of ties, return the first occurrence of the largest word. Note the return type is String. Example, String 1arge large largestBy("I am the very model of a modern major general") System.out.printin(large); // should print general 2.3 (Optional) Now, using above two methods, see if you can combine them in one single method and still produce the same outputs? NOTE: use an integer to determine which algorithm your code will execute, e.g String largestByAction(String inputText, int action) If integer action is 1, then run first algorithm and if integer action is 2, then run the 2nd algorithm. Also, if the integer action is anything other than 1 or 2, return the empty string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
