Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6.  
  7. /**
  8. *
  9. * @author bdb52
  10. */
  11. public class StackDriver {
  12. public static void main(String [] args){
  13. System.out.println("Testin' this stack out.");
  14. System.out.println();
  15. StackSort <Integer> s = new StackSort<>();
  16. s.add(-1);
  17. s.add(1);
  18. s.add(3);
  19. s.add(5);
  20. s.add(10);
  21. System.out.println("Checkin' da size: " + s.size());
  22. System.out.println("Checking the contents of this bad boi (should be -1, 1, 3, 5, 10): ");
  23. for (Object i : s.toArray())
  24. System.out.print(i + " ");
  25. System.out.println();
  26. // System.out.println("Now we removin' -4 (should return false): " + s.remove(14)); // errors the fuckkk out
  27.  
  28. System.out.println("Removing this bitchass 1(should be true): " + s.remove(1));
  29.  
  30. System.out.println("Checking the size of this shit(should be a good ol' 4): " + s.size());
  31. System.out.println("Checking if this shit contains a 3 (should be true): " + s.contains(3));
  32. System.out.println("Checking if this shit contains a 1 (should be a hard false): " + s.contains(1));
  33. System.out.print("Checking the size one more time: " + s.size());
  34. System.out.println();
  35. System.out.print("iight we done");
  36. System.out.println();
  37. // System.out.println("Checking the contents of this bad boi (should be -1, 3, 5, 10): ");
  38. // for (Object i : s.toArray())
  39. // System.out.print(i + " ");
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement