public class Solucion {
    private final static Logger LOG = Logger.getLogger(Solucion.class);

    private Node build() {
        LOG.info("Construyendo un Node list inicial");
        Node n1 = new Node("A");
        Node n2 = new Node("B");
        Node n3 = new Node("C");
        Node n4 = new Node("D");
        Node n5 = new Node("E");
        Node n6 = new Node("F");
        n1.next = n2;
        n2.next = n3;
        n3.next = n4;
        n4.next = n5;
        n5.next = n6;
        return n1;
    }

    public void ok() {
        LOG.info("método principal cuasi prueba");
        Node a = build();
        a.prn();
        a = a.gus();
        a.prn();
        a = a.gus();
        a.prn();
        
        Node b = new Node("X");
        b = b.gus();
        b.prn();
        
        Node c = new Node("X");
        Node d = new Node("Y");
        c.next = d;
        c = c.gus();
        c.prn();   
    }

    public static void main(String...argv) {
        LOG.info("Invocando al método main");
        new Solucion().ok();
    }

}

Sorry, the comment form is closed at this time.

© 2020 Goose Workshop Suffusion theme by Sayontan Sinha