Hi There!
I have a problem about OOP_ java, I need a little descriptionplease,
In this exercise, use the Template method patterninstead to define an abstract class Filter with a publicmethodfilter (the template method) that calls the method accept(the hook method) that can be implemented in different ways in thedifferent concrete classes. Write a test program by extending theclass Filter and defining accept so that only strings of at mostthree characters are accepted.
Thanks!
Here is my Filter
public interface Filter{
boolean accept(String x);
}
_____________________________________________________________________________________________________
public class FilterTest{
public static String[]filter(String[]a,Filter f) {
//create inner class for polynomialInterface
f = new Filter() {
public boolean accept(Stringx) {
if(x.length()<=3){
return true;
}
else{
return false;
}
PayPal Gateway not configured
PayPal Gateway not configured