5 Answers
New Answerno need to put brackets , it U only want to execute a single statement if if () condition evaluates to true //Hatsy done right thing by using && same set of statement(s) are executing in the code having 2 if () statements //can be written as :: if (x > 30) if (x < 60) // do something //can simply be if (x > 30 && x < 60) // do something
Really depends on what you want to do, or what you mean by "joining more than one if operation". int x = 56; if (x > 30) { if (x < 60) { // do something } } can simply be if (x > 30 && x < 60) { // do something }
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message