Question: Write a Java program that reads in a set of tokens and prints them out in alphabetical order, one token per line subject to the

Write a Java program that reads in a set of tokens and prints them out in alphabetical order, one token per line subject to the following:

1. Your main class, sortToken, must extend StringTokenizer.

2. Your class must implement a method called "alphaSort" with the following signature: String alphaSort(String str);

Your program must match the example below:

Program to sort tokens alphabetically.

Enter string: Hello my first and last name is John Zebra

Hello

John

Zebra

and

first

is

last

my

name

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!