Full Code (what's wrong with this code giving false with any entity.)

public class wildcard {

public static void main(String[] args) {
String src = "abcdef";
String ptrn = "b?*******";
//System.out.println(wildrec(src,ptrn));
System.out.println(wildTd(src,ptrn,0,0));
}
public static boolean wildrec (String src, String ptrn ) {
	if(src.length()!=0||ptrn.length()==0)
		return false;
	if(src.length()==0||ptrn.length()==0) {
		return true;
	}
	if(src.length()==0||ptrn.length()!=0) {
		for(int i = 0;i<ptrn.length();i++) {
			if(ptrn.charAt(i)!='*') {
				return false;
			}else {
				return true;
			}
		}
	}
	char a = src.charAt(0);
	char b = ptrn.charAt(0);
	
	String ros = src.substring(1);
	String rop = ptrn.substring(1);
	boolean ans;
if(b==a||b=='?') {
	
	ans =wildrec(ros,rop);

}else if(b=='*') {
	boolean blank = wildrec(src,rop);
	boolean mult = wildrec(ros,ptrn);
	
	ans = blank || mult;
}else {
	ans = false;
}
return ans;
}
public static boolean wildTd(String src,String ptrn ,int svidx,int pvidx) {
	
	if(src.length()==svidx||ptrn.length()==pvidx) 
		return true;
		if(src.length()!=svidx||ptrn.length()==pvidx) {
			return false;
	}
	if(src.length()==svidx||ptrn.length()!=pvidx) {
		for(int i = 0;i<ptrn.length();i++) {
			if(ptrn.charAt(i)!='*') {
				return false;
			}else {
				return true;
			}
		}
	}
	char a = src.charAt(svidx);
	char b = ptrn.charAt(pvidx);
	
	boolean ans ;
	
	if(b==a||b=='?') {
		ans = wildTd(src,ptrn,svidx+2,pvidx+1);
	}else if(b=='*') {
		boolean blank = wildTd(src,ptrn,svidx,pvidx+1);
		boolean mult = wildTd (src,ptrn,svidx+1,pvidx);
		
		ans = blank || mult;
	}else {
		ans = false;
	}
	return ans ;
}

}

Hey @sanket_singh There is just one silly mistake look for this part of code in wildrec Function.
public static boolean wildrec (String src, String ptrn ) {
if(src.length()!=0||ptrn.length()==0)
return false;
if(src.length()==0||ptrn.length()==0) {
return true;
}
You have used OR gate But you need to use AND gate.here like this.
if(src.length()!=0 && ptrn.length()==0)
return false;
if(src.length()==0 && ptrn.length()==0) {
return true;
}

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.