• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generics Issue  RSS feed

 
Arulanand Dayalan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to write a generic implementation for an putAll method. In the implementation class i am not able to print the attributes of the Bean (e.g. name ,id ). Can you please let me why this happens or is there any other way to achieve it.



Thanks in Advance.

Regards,
Arul.
 
Paweł Baczyński
Bartender
Posts: 2083
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is this line:In this case Bean1 is not the name of a class Bean1. It is a generic parameter name.

This line is an equivalent to:You need to write:
 
Arulanand Dayalan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paweł. Got it now.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!