Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Vector;
- public class Driver {
- private StringContainer b = null;
- public static void main(String[] args){
- Driver d = new Driver();
- d.run();
- }
- public void run() {
- b = new StringContainer();
- b.add("One");
- b.add("Two");
- b.remove("One");
- }
- }
- class StringContainer {
- private Vector v = null;
- public void add(String s) {
- init();
- v.add(s);
- }
- public boolean remove(String s) {
- init();
- return v.remove(s);
- }
- private void init() {
- if (v == null)
- v = new Vector();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement