-
Notifications
You must be signed in to change notification settings - Fork 0
/
FirstRunner.java
executable file
·67 lines (62 loc) · 2.11 KB
/
FirstRunner.java
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import static java.lang.System.*;
public class FirstRunner
{
public static void main ( String[] args )
{
FirstAndLast demo = new FirstAndLast("Hello");
System.out.println( "word :: " + demo.toString() );
System.out.println( "first letter :: " + demo.getFirst() );
System.out.println( "last letter :: " + demo.getLast() );
//add more test cases
/*
System.out.println();
System.out.println();
demo.setString("World");
System.out.println( "word :: " + demo.toString() );
System.out.println( "first letter :: " + demo.getFirst() );
System.out.println( "last letter :: " + demo.getLast() );
System.out.println();
System.out.println();
demo.setString("JukeBox");
System.out.println( "word :: " + demo.toString() );
System.out.println( "first letter :: " + demo.getFirst() );
System.out.println( "last letter :: " + demo.getLast() );
System.out.println();
System.out.println();
demo.setString("TCEA");
System.out.println( "word :: " + demo.toString() );
System.out.println( "first letter :: " + demo.getFirst() );
System.out.println( "last letter :: " + demo.getLast() );
System.out.println();
System.out.println();
demo.setString("UIL");
System.out.println( "word :: " + demo.toString() );
System.out.println( "first letter :: " + demo.getFirst() );
System.out.println( "last letter :: " + demo.getLast() );
*/
for (int x=2; x<=5; x++)
{
if(x == 2)
{
demo.setString("World");
}
if(x == 3)
{
demo.setString("JukeBox");
}
if(x == 4)
{
demo.setString("TCEA");
}
if(x == 5)
{
demo.setString("UIL");
}
System.out.println();
System.out.println();
System.out.println( "word :: " + demo.toString() );
System.out.println( "first letter :: " + demo.getFirst() );
System.out.println( "last letter :: " + demo.getLast() );
}
}
}