-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWordRunner.java
More file actions
33 lines (26 loc) · 867 Bytes
/
WordRunner.java
File metadata and controls
33 lines (26 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Arrays;
import static java.lang.System.*;
public class WordRunner
{
public static void main( String args[] )
{
Word[] words = {new Word("freddy"), new Word("at"), new Word("elephant"),
new Word("whoooooodat"), new Word("alice"), new Word("tommy"),
new Word("bobby"), new Word("it"), new Word("at"), new Word("about"),};
out.println("Before:");
for(int i=0; i<10; i++)
{
System.out.println(words[i]);
}
Arrays.sort(words);
out.println("\n\nAfter:");
for(int i=0; i<10; i++)
{
System.out.println(words[i]);
}
}
}