java - I need.setText parameter to be recognized as method , not as a string -


i have problem following code:

question1.settext("question1_" + question_number() + "()"); 

i have multiple methods return string value , named "question1_x" (x number) , method question_number returns random number. when run code "question1" text set "question1_x()" , need set text "question1_x()" method returns it. ["question1_" + question_number() + "()"] seen ".settext" method , not string.

thank in advance :)

java won't let unless resort reflection. reflection wrong solution problem.

any time want have numbered methods and/or fields, step , consider using proper collection (say, list) instead. start replacing numbered methods single method takes number:

string question1(int questionnumber) 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -