Hi guys,
I wrote the following code:
public static boolean match(int[] a , int[] pattern)
{
//need to use the overloaded method, in order to work with the static method.
return match(a,pattern,0,0);
}
/** This is an overloaded method that match between a pattern to a given string (as an array)*/
private boolean match(int[] a, int[] pattern, i, j )
{
if(j==pattern.length)
return true;
if( (i==a.length) && (j!=pattern.length) )
return false;
switch(pattern[j]){
case 1: if( (a[i]/10)==0 )
return match(a, pattern, i+1, j+1);
return match(a, pattern, i+1, j);
break;
case 2: if( ( (a[i]/10)==0 ) && ( (a[i]/100)==0) )
return match(a, pattern, i+1, j+1);
return match(a, pattern, i+1, j);
break;
case 0: if ( ( (a[i]/10)==0 ) || (( (a[i]/10)==0 ) && ( (a[i]/100)==0)) )
return match(a, pattern, i+1, j+1);
return match(a, pattern, i+1, j);
break;
}
}
For some unknown reasonable reason, I get an error for the static method call although I ran it through another one...
Please help me make it complie as well...
Thank you all !!