Create Tree (Using Postorder and Inorder)

import java.util.*;
public class Main {

static Scanner scn = new Scanner(System.in);

public static void main(String[] args) {
	Main m = new Main();
	int[] post = takeInput();
	int[] in = takeInput();
	BinaryTree bt = m.new BinaryTree(post, in);
	bt.display();
}

public static int[] takeInput() {
	int n = scn.nextInt();

	int[] rv = new int[n];
	for (int i = 0; i < rv.length; i++) {
		rv[i] = scn.nextInt();
	}

	return rv;
}

private class BinaryTree {
	private class Node {
		int data;
		Node left;
		Node right;
	}

	private Node root;
	private int size;

	public BinaryTree(int[] post, int[] in) {
		this.root = this.construct(post, 0, post.length - 1, in, 0, in.length - 1);
	}

	private Node construct(int[] post, int plo, int phi, int[] in, int ilo, int ihi) {
            if(ilo>ihi || phi<plo){
                return null;
            }
               Node nn = new Node();
               nn.data = post[phi]; 
            if(ilo==ihi){
               
               return nn;
            }
            
            int i =ilo;
            for(;i<ihi;i++){
                if(nn.data == in[i]){
                    break;
                }
            }

          

        Node left = construct(post,plo,phi-1,in,ilo,i-1);
        Node right = construct(post,plo,phi-1,in,i+1,ihi);
        nn.left = left;
        nn.right = right;
        return nn;
	}

	public void display() {
		this.display(this.root);
	}

	private void display(Node node) {
		if (node == null) {
			return;
		}

		String str = "";

		if (node.left != null) {
			str += node.left.data;
		} else {
			str += "END";
		}

		str += " => " + node.data + " <= ";

		if (node.right != null) {
			str += node.right.data;
		} else {
			str += "END";
		}

		System.out.println(str);

		this.display(node.left);
		this.display(node.right);
	}

}

}

Can you hrelp me with the code and logic