Why we should put flag ="no" before function call in code?

import java.util.*;
public class Main {
public static String flag = “No”;

public static void main(String[] args) {
	 Scanner scn=new Scanner(System.in);
        int t=scn.nextInt();
        for(int i=0;i<t;i++) {
        	int n=scn.nextInt();
        	int [] arr=new int[n];
        	for(int j=0;j<n;j++) {
        		arr[j]=scn.nextInt();
        		
        	}
			flag="No"; // why it is placed here??
        	Subset( arr,0,0,"");
    		System.out.println(flag);
        }
	

	

}
public static void Subset(int [] arr,int lo,int sum,String ans) {
	
		
	
	if ( lo==arr.length) {
		if (sum==0 && ans.length() !=0) {
		flag="Yes";
		}
		
		return;
	}
	Subset(arr,lo+1,sum+arr[lo],ans+arr[lo]);
	
	Subset(arr,lo+1,sum,ans);
	
	
	
}

}

So bro the flag is static here and we have multiple test cases t, so before every test case, the flag is initialized to initial state here .