unknown unknown - 3 months ago 7
Java Question

It might be silly to ask, but how can I get this work?

how get the string out of the if statement !?

Is it possible?

I know that I can move

tv.setText(b)
to both if and else ... but I need do it in this way.


int a =1;
if(average == a){
String b = "Yes";
}else {
String b = "No";
}
tv.setText(b)

Answer
int a =1;
String b;
        if(average == a){
            b = "Yes";
        }else {
            b = "No";
        }
tv.setText(b)
Comments