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

how to use one methods paramete in another ?  RSS feed

 
kenji kunoichi
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a method like methodA ( String username , String password )

now in another method method B () I want to use value generated inside method A . how to do that ?
 
Mohamed Sanaulla
Bartender
Posts: 3174
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can return the value from the method.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you add a parameter to methodB ?
 
Habeeb Shaikh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Christophe ,
What is your requirement you need same parameter of method A() or return value of method A()
 
Mohamed Sanaulla
Bartender
Posts: 3174
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Habeeb Shaikh wrote:Hi Christophe ,
What is your requirement you need same parameter of method A() or return value of method A()


Christophe is trying to help the OP.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!