Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Type of a class  RSS feed

 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Method object. I want to know the type of the parameters the method accepts. How do I fin that?

I want to type of each of args element.
 
Tom Blough
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the class Class. Class.getMethod().getParameterTypes() should give you what you want
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it! The getName() is useful. thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!