mercredi 4 novembre 2015

java if statement string comparison

String a="i=1 && j<=2";
String b="i<=0 && j==2";

for(i=0;i<=10;i++){
for(j=0;j<=5;j++){
**if(a){**
System.out.println("yes");
else if(b){
System.out.println("not");
}}}}

How i convert string to code in if statement? if(i=1 && j<=2) false if(a) true but how?

Aucun commentaire:

Enregistrer un commentaire