Question: Write a program that reads words from a text file and displays all the words (duplicates allowed) in ascending alphabetical order. The words must start

Write a program that reads words from a text file and displays all the words (duplicates allowed) in ascending alphabetical order. The words must start with a letter.

Test your program with the Welcome.java file:

Please input the Java filename: Welcome.java Java This Welcome application args class displays int public static to void

Here is the code:

import java.util.*;

public class HW3_Q2 {

public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

System.out.print("Please input the Java filename: ");

String filename = scanner.nextLine();

scanner.close();

// Your code here

// ...

}

}

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!