• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to typeCast Dynamically ....?  RSS feed

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All

As we know in Downcasting we need to specify the class name (Hardcoded)

like

Is it possible to make dynamically like i ll aasign the' y ' to one string value
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Usually you'll use a common interface for this. The class implements this interface, and you cast to the interface and call the interface's methods.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!