Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Node{
- ArrayList<Node> childobjects;
- public Node(String class, String name, String info){
- this.class = class;
- this.name = name;
- this.info = info;
- this.childobjects = new ArrayList<Node>();
- String str = this.addChild();
- }
- public String addChild(Node child){
- this.childobjects.add(child);
- return "child added";
- }
- public static void main(String[] args) {
- Node node = new Node("Liv","Vaxt","fin");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment