-
Notifications
You must be signed in to change notification settings - Fork 0
/
IntStackTestLab3.java
38 lines (30 loc) · 987 Bytes
/
IntStackTestLab3.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
package unit08.mySolutions;
public class IntStackTestLab3 {
public static void main(String[] args) {
IntegerStack test1 = new IntegerStack();
IntegerStack test2 = new IntegerStack();
test1.push(90);
test1.push(3);
test1.push(243);
test1.push(15);
test1.push(57);
test1.push(305);
test1.print();
test2.print();
// Tests to see if copy stack is too small
if(test2.copyStack(test1, 4))
test2.print();
else
System.err.println("Stack too small");
// Tests to see if target stack is too small
if(test2.copyStack(test1, 6))
test2.print();
else
System.err.println("Target stack too small");
// Tests if source stack is too small
if(test2.copyStack(test1, 8))
test2.print();
else
System.err.println("Source stack too small");
}
}