java - How to change the order of IF statments based on a variable (from server) -


sorry if it's noob question starting learning coding zero. there more concise way change order of if statement based on variable?

of course below code wondering if there way obtain similar result in more simple way instead of having write every single order combination. sorry again if question stupid.

if (mfirebaseremoteconfig.getstring(key) equals 1) {         if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }         if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }     } else if (mfirebaseremoteconfig.getstring(key) equals 2) {         if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }         if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }     } else if (mfirebaseremoteconfig.getstring(key) equals 3) {         if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }         if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }     } else if (mfirebaseremoteconfig.getstring(key) equals 4) {         if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }         if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }        } else if (mfirebaseremoteconfig.getstring(key) equals 5) {         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }            if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }            if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }                } else if (mfirebaseremoteconfig.getstring(key) equals 6) {         if (yyy_start_status.isloaded()) {             yyy_start.display();             return true;         }            if (zzz_start_status.isloaded()) {             zzz_start.display();             return true;         }            if (xxx_start_status.isloaded()) {             xxx_start.display();             return true;         }                        } 


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -