It is showing an answer from the given sample input in the question(0, 1, 4, 2, 3, 5, 6, 8, 7, 9, 10, 11) what correction it needs in my program

import java.util.*;
public class Heap {
ArrayList list = new ArrayList();

public void add(int item) {
	list.add(item);
	upheapify(list.size()-1);
}

private void upheapify(int ci) {
	int pi = (ci-1)/2;
	if(list.get(ci)<list.get(pi)){
		swap(pi,ci);
		upheapify(pi);
	}
}

private void swap(int pi, int ci) {
	int ith = list.get(pi);
	int jth = list.get(ci);
	list.set(ci,ith);
	list.set(pi,jth);
}
public void display() {
	System.out.println(list);
}

}
public class Main {

public static void main(String[] args) {
    Scanner sc  = new Scanner(System.in);
    Heap heap = new Heap();
    int k = sc.nextInt();
    int n = sc.nextInt();
    int arr[][] = new int[k][n];
    for(int i=0;i<k;i++){
        for(int j = 0;j<n;j++){
            heap.add(sc.nextInt());
        }
    }
    heap.display();
}

}

your code gives error on sample input even.

in line 4 your declaration of arraylist is wrong.it should be:
ArrayList< Integer > list = new ArrayList<>();

after that your code is giving the wrong output for the sample test case…try and dry run the sample input.

please copy your code on online ide ( https://ide.codingblocks.com), save it and share the corresponding link for next time.