Parameterized interface

  • 3
  • Locked
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.
You can't complete this task, because you're not signed in.
Comments (7)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Level 20 , Ajmer, India
4 June 2019, 12:46
I did not understand this. What is parameterized interface and what does it do?
Liliane Top
Level 17 , Amsterdam, Netherlands
7 March 2020, 19:51
I also do not understand the question or what we are suppose to do... Very unclear!
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.
Liliane Top
Level 17 , Amsterdam, Netherlands
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.
Lucas Hoage
Level 14 , Savannah, United States
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.
Lucas Hoage
Level 14 , Savannah, United States
12 June 2020, 03:13
Thank you for the follow up. Glad it's almost the weekend so I can dive into this.