Course Solutions Uncategorized (Solved) : Hi Problem Oop Java Need Little Description Please Exercise Use Template Method Pattern In Q36597733 . . . .

(Solved) : Hi Problem Oop Java Need Little Description Please Exercise Use Template Method Pattern In Q36597733 . . . .

 

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;

}

  

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post