Create a sentence with the shortest words - Java Quiz Question



Write a program to create a sentence containing only the shortest words from the given sentence.

Input (String) Output (String)
That man has reached immortality who is disturbed by nothing material. is by
The for statement provides a compact way to iterate over a range of values. a a
Every variable should have datatype like int, boolean etc., int etc
Learn Java with Merit Campus Java with

class CreateSentenceWithShortestWords

{    public static void main(String s[])
    {
        String input = "That man has reached immortality who is disturbed by nothing material.";
        System.out.println("The resultant sentence is : " + getSentenceWithShortestWords(input));

    }


public static String getSentenceWithShortestWords(String inputSentence) {
//Write code here to get sentence containing only shortest words from given sentence
}

private static int getShortestWordLength(String inputSentence) {
//Write code here to find shortest word length
}
}