Run error while executing

why am i getting run error here? it is working fine on netbeans.

import java.util.*;
public class Generic_tree {
private class Node
{
int data;
ArrayList children;
Node(int data)
{
this.data=data;
this.children=new ArrayList<>();
}
}
private Node root=null;
private int size=0;

public Generic_tree() {
    Scanner s=new Scanner(System.in);
    this.root=takeinput(s,null,0);
}
private Node takeinput(Scanner s,Node parent,int ith_child)
{
    int nodedata=s.nextInt();
    Node node=new Node(nodedata);
    this.size++;
    
    int children=s.nextInt();
    for(int i=0;i<children;i++){
        Node child=this.takeinput(s, node, i);
        node.children.add(child);
    }
    return node;
}
public void display()
{
    this.display(this.root);
}
private void display(Node node)
{
    String str=node.data+"=>";
    for(int i=0;i<node.children.size();i++)
    {
        str= str+ node.children.get(i).data+",";
    }
    str=str+"end";
    System.out.println(str);
    
    for(int i=0;i<node.children.size();i++)
    {
        this.display(node.children.get(i));
    }
}

public int kth_sum(int k)
{
    return this.kth_sum(this.root,k);
}
private int kth_sum(Node node,int k)
{
    if(k<0)
        return -1;
        
    if(k==0)
        return node.data;
    
    int sum=0;
    for(int i=0;i<node.children.size();i++)
    {
        sum=sum+kth_sum(node.children.get(i), k-1);
    }
    return sum;
}
// 1 2 2 2 3 0 4 0 5 2 6 0 7 0 2
public static void main(String[] args) {
    Generic_tree tree=new Generic_tree();
  
    Scanner sc=new Scanner(System.in);
    int k=sc.nextInt();
    System.out.println(tree.kth_sum(k));
}

}

this is the code .

can you please describe the run time error?
what is name of the error?
thanks

Compile Message
run-error

import java.util.*;
class Node
{
int data;
ArrayList children;
Node(int data)
{
this.data=data;
this.children=new ArrayList();
}
}
public class Generic_tree {
private Node root=null;
private int size=0;
public Generic_tree(Scanner s) {

this.root=takeinput(s);

}
private Node takeinput(Scanner s)
{
int nodedata=s.nextInt();
Node node=new Node(nodedata);
this.size++;

int children=s.nextInt();
for(int i=0;i<children;i++){
    Node child=this.takeinput(s);
    node.children.add(child);
}
return node;

}
public void display()
{
this.display(this.root);
}
private void display(Node node)
{
String str=node.data+"=>";
for(int i=0;i<node.children.size();i++)
{
str= str+ node.children.get(i).data+",";
}
str=str+“end”;
System.out.println(str);

for(int i=0;i<node.children.size();i++)
{
    this.display(node.children.get(i));
}

}

public int kth_sum(int k)
{
return this.kth_sum(this.root,k);
}
private int kth_sum(Node node,int k)
{
if(k<0)
return -1;

if(k==0)
    return node.data;

int sum=0;
for(int i=0;i<node.children.size();i++)
{
    sum=sum+kth_sum(node.children.get(i), k-1);
}
return sum;

}
// 1 2 2 2 3 0 4 0 5 2 6 0 7 0 2
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
Generic_tree tree=new Generic_tree(s);

// Scanner sc=new Scanner(System.in);
int k=s.nextInt();
System.out.println(tree.kth_sum(k));
tree.display();

}}

I fixed the code. please have a look. there are some minor changes.
thanks

you made changes in takeinput function.it is still showing run error in code editor. working fine in netbeans

i made other changes as well like getting the class Node out. please try to paste my code in editor and let me know if it works.
thanks

Still not working
Same run error

wherever you are creating ArrayList, please make sure that it is of type int…
like ArrayList$Node$ children = new ArrayList$Node$();

replace $ by angular brackets…
I modified this in my earlier code but it did not show up due to problem with angular brackets.
please check it again.
thanks

I checked this code https://ide.codingblocks.com/s/209041 for various test cases and its perfectly fine. there is some platform issue on hackerblocks. i tried submitting it, but its not responding anything. it happens sometimes due to some technical glitch.

thanks

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.