Passing of scanner object in the function

int data=sc.nextInt();
Node node=new Node(data,null,null);
this.size++;

	boolean choice=false;
	System.out.println("LEFT CHILD???");
	choice=sc.hasNextBoolean();
	if(choice)
	{
		node.left=takeInput(sc,null,null);

/this here can someone explain why scanner object
has been passed and how is it working precisely
/

}

@guneetsk99,
Can you please attach the entire code piece?

In the code you have attached, there’s no creation of a Scanner object

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.