classloader - java: Dynamic class loading with an interface to be implemented by the loaded class -


i trying dynamic class loading uni assignment. here code interface , part of test class.

public interface addressbookdatastore {      void addperson(person p);      person[] getpersons(string name);      void remove(person p);     boolean contains(string name); }    public class testklasse {      public static void main (string[] args){          class clazz =  class.forname("addresbook");         object object = clazz.newinstance(); 

my task implement testclass in such way compiler allows me load (and not implement!) methods of addresbookdatastore implemented class addresbook. don't understand how possible, since talking loading class know nothing about. method newinstance() delivering nur object nothing else.. missing something?

thanks!

mel


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -