java.lang.StackOverflowError when trying to add the same instance of list multiple times
问题 How to resolve java.lang.StackOverflowError for the following code? Person.java import java.util.List; public class Person { private String name; private List<Person> children; public Person() { } public Person(String name, List<Person> children) { this.name = name; this.children = children; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Person> getChildren() { return children; } public void setChildren(List<Person> children) {