Guest User

Untitled

a guest
Nov 29th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Node{
  4. ArrayList<Node> childobjects;
  5.  
  6. public Node(String class, String name, String info){
  7. this.class = class;
  8. this.name = name;
  9. this.info = info;
  10. this.childobjects = new ArrayList<Node>();
  11. String str = this.addChild();
  12. }
  13.  
  14. public String addChild(Node child){
  15. this.childobjects.add(child);
  16. return "child added";
  17. }
  18.  
  19. public static void main(String[] args) {
  20. Node node = new Node("Liv","Vaxt","fin");
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment