View Single Post
  #3 (permalink)  
Old 12-06-2007, 11:09 PM
hardwired hardwired is online now
Senior Member
 
Join Date: Jul 2007
Posts: 1,266
hardwired is on a distinguished road
You must provide the method declaration for each method defined in the implemented interface. What you do in the method body is up to you.
In pseudo code:
Code:
public interface Mapper { public void createSchema(); public int getNoOfClasses(); public void setHost(String hostName); } class NeedAllMethods implements Mapper { public void createSchema() { // implementation... } public int getNoOfClasses() { // implementation... return intValue; } public void setHost(String hostName) { // implementation... } } class NeedOnlyOne implements Mapper { public void createSchema() { // no-op okay } public int getNoOfClasses() { // no-op okay but you must // return an int value. return 0; } public void setHost(String hostName) { // no-op okay } }
Reply With Quote