Question: 5. Adapter pattern //interface NameInterface interface NameInterface { public void setName(String n); public String getName(); } // Adaptee class class SimpleName implements NameInterface { String

5. Adapter pattern //interface NameInterface interface NameInterface { public void setName(String n);

public String getName(); }

//Adaptee class class SimpleName implements NameInterface { String name;

public void setName(String n) { name = n; }

public String getName() { return name; } }

//Target interface interface FullNameInterface { public void setFirstName(String f);

public void setLastName(String l);

public String getFirstName();

public String getLastName(); }

a. Create an adapter to convert the interface NameInterface to FullNameInterface b. Write a main method test the adapter.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!