/*-----------------MAIN-----------*/ public static void main(String[] args) { Sarray s = new Sarray(); System.out.println(s); s.add("hola"); System.out.println(s); System.out.println(s.size()); s.add(4, "mundo"); System.out.println(s); // s.add(99,"mundo"); // System.out.println(s); System.out.println(s.size()); System.out.println(); System.out.println(); System.out.println(s.get(0)); System.out.println(s); s.remove(0); System.out.println(s); System.out.println(); System.out.println(); System.out.println(); s.set(0, "hola"); System.out.println(s); }
/*------------ Main -------------*/ public static void main(String[] args) { Sarray s = new Sarray(); s.add("toy"); s.add("door"); System.out.println(s); s.add("poor"); s.add("shore"); System.out.println(s); s.add("lore"); System.out.println(s); try { s.add(5, "more"); System.out.println("it's all good"); } catch (Exception e) { System.out.println("Error: " + e); } System.out.println(s); System.out.println(s.size()); }
public boolean add(String s) { super.add(place(s), s); return true; }