Skip to content

Instantly share code, notes, and snippets.

@fikovnik
Created December 7, 2012 09:11
Show Gist options
  • Save fikovnik/4232017 to your computer and use it in GitHub Desktop.
Save fikovnik/4232017 to your computer and use it in GitHub Desktop.
package tp8;
public class App {
public static void main(String[] args) {
IPlugin plugin = loadPlugin("PluginA");
plugin.printMessage();
}
private static IPlugin loadPlugin(String string) {
// TODO Auto-generated method stub
return null;
}
}
package tp8;
public interface IPlugin {
public void printMessage();
}
package tp8;
public class PluginA implements IPlugin {
@Override
public void printMessage() {
System.out.println("Hi from Plugin A");
}
}
package tp8;
public class PluginB implements IPlugin {
@Override
public void printMessage() {
System.out.println("Hi from Plugin B");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment