Arrays Program

Problem

Write a program in Java that takes a sentence as input and outputs all of the words (i.e. characters separated by spaces) from shortest to smallest.

Example 1:

Input:

This is a simple sentence without any punctuation for testing purposes only

Output:

a
is
any
for
This
only
simple
without
testing
sentence
purposes
punctuation