Remember generics? They are generalizations - parametrized types, right? If not, rack your brain, then search through the lessons, and then search Google. Or use a different order if you'd like. Then, look at this task's code and make the StringObject class implement the SimpleObject interface using a String parameter.
Parameterized interface
- 3
Locked
Comments (7)
- Popular
- New
- Old
You must be signed in to leave a comment
Aman
4 June 2019, 12:46
I did not understand this. What is parameterized interface and what does it do?
+1
Liliane Top
7 March 2020, 19:51
I also do not understand the question or what we are suppose to do... Very unclear!
0
Alex Vypirailenko Java Developer at Toshiba Global Comme
8 March 2020, 10:06
Look at the SimpleObject interface syntax. The means a generic parameter, which means that when you implement this interface, you can add a parameter of your choosing instead of T. In the case with this case, we are asking you to use String as a parameter.
0
Liliane Top
8 March 2020, 10:51
Hi Alex, I got the solution but got stuck with the return value. I now understand that I could either use return null; or return this; And not return String; As there is no String object declared nor initialised. I got this from another learner. Sometimes the help section works very good in helping me understand.
0
Lucas Hoage
10 June 2020, 02:43
In what practical situation is this used? I understand what it is asking me to pass through when implementing the intrface, I just don't understand when or why we would use this.
0
Alex Vypirailenko Java Developer at Toshiba Global Comme
11 June 2020, 06:08
These articles should help understand Generics a bit better:
https://codegym.cc/groups/posts/214-what-are-generics-in-java
https://codegym.cc/groups/posts/generics-in-java
https://codegym.cc/groups/posts/292-wildcards-in-generics
https://codegym.cc/groups/posts/290-type-erasure
+2
Lucas Hoage
12 June 2020, 03:13
Thank you for the follow up. Glad it's almost the weekend so I can dive into this.
0