if statement - Two separate if clauses or one single if else -


stupid question, practice use 2 separate if clauses or 1 single if if else clause, eg:

if (a = 1) (dosomething) if (a=2) (do other thing) 

or

if (a=1) (do something) else if (a=2) (do other thing) 

those 2 if conditions not true same time. variable used comparator , not changed @ all.

the 2 ways work expected , nothing programmatically wrong it, asking practice , recommended?

i'd use style easier read.
clarity better difficult follow code.

execution speed isn't going big problem here.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -