Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author bdb52
- */
- public class StackDriver {
- public static void main(String [] args){
- System.out.println("Testin' this stack out.");
- System.out.println();
- StackSort <Integer> s = new StackSort<>();
- s.add(-1);
- s.add(1);
- s.add(3);
- s.add(5);
- s.add(10);
- System.out.println("Checkin' da size: " + s.size());
- System.out.println("Checking the contents of this bad boi (should be -1, 1, 3, 5, 10): ");
- for (Object i : s.toArray())
- System.out.print(i + " ");
- System.out.println();
- // System.out.println("Now we removin' -4 (should return false): " + s.remove(14)); // errors the fuckkk out
- System.out.println("Removing this bitchass 1(should be true): " + s.remove(1));
- System.out.println("Checking the size of this shit(should be a good ol' 4): " + s.size());
- System.out.println("Checking if this shit contains a 3 (should be true): " + s.contains(3));
- System.out.println("Checking if this shit contains a 1 (should be a hard false): " + s.contains(1));
- System.out.print("Checking the size one more time: " + s.size());
- System.out.println();
- System.out.print("iight we done");
- System.out.println();
- // System.out.println("Checking the contents of this bad boi (should be -1, 3, 5, 10): ");
- // for (Object i : s.toArray())
- // System.out.print(i + " ");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement