Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- public class MyElementsTree {
- private ArrayList<String> lista = new ArrayList<String>(3);
- public void add(String...elements){
- for(String e : elements)
- lista.add(e);
- }
- public String toString(){
- return lista.toString();
- }
- public static void main(String[] args){
- MyElementsTree m1 = new MyElementsTree();
- m1.add("Ana"); m1.add(" are "); m1.add(" un hotel ");
- m1.add(" o vila", " si ", "o casa de vacanta la mare");
- System.out.println(m1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement