"Hi, Amigo! I came up with a couple of interesting tasks for you."
"They can only be completed in IntelliJ IDEA. Take a look at these interesting conditions…"
undefined
14
Task
Java Collections,
level 2,
lesson 8
Locked
Creating a proxy object
1) In a separate file, create a public CustomInvocationHandler class that will be the invocation handler when creating a proxy object.
2) CustomInvocationHandler must support the InvocationHandler interface.
undefined
14
Task
Java Collections,
level 2,
lesson 8
Locked
Generics for creating a proxy object
Create a public getProxy() method in the Solution class:
1) The getProxy() method must return a proxy for any interface that inherits Item.
2) The getProxy() method must have two parameters.
Class[] interfaces = {SomeInterfaceWithMethods.class}; - what is this??? {} it's a static block or what???
Justin SmithLevel 41, Greenfield, USA, United States
30 August 2022
If, like me, you were utterly stumped by the second task here, then still just as stumped after looking at the solution... Well, for me, I realized that I had no idea what the difference was between using the generic <T> vs. <?>. They both refer to an unknown object type, so when you use each of them?
I found the top-ranked explanation here very useful and I recommend it for anyone else who is having difficulty with this subject.
https://stackoverflow.com/questions/10943137/difference-between-generic-type-and-wildcard-type
This website uses cookies to provide you with personalized service. By using this website, you agree to our use of cookies. If you require more details, please read our Terms and Policy.
GO TO FULL VERSION