In the previous lesson, they have the following block of code:
Reader original = new UserCustomReader();
Reader reader = (Reader)Proxy.newProxyInstance(new CustomInvocationHandler(original));
In general, the structure is:
InterfaceName original = new ClassThatImplementsInterface();
InterfaceName proxyInstance = (InterfaceName) Proxy.newProxyInstance(new CustomInvocationHandler(original));
However, when trying to solve this task, the following code does not compile:
SomeInterfaceWithMethods original = new SomeInterfaceWithMethodsImpl();
SomeInterfaceWithMethods proxyInstance = (SomeInterfaceWithMethods) Proxy.newProxyInstance(new CustomInvocationHandler(original));
I am trying to figure out why my code does not work if the code in the lesson would work.