Lesson 7 of 34
else if: అనేక ఎంపికలు
8 min 25 XP
రెండు కంటే ఎక్కువ ఎంపికలు ఉంటే else if వాడండి. Java పై నుండి కిందకు తనిఖీ చేసి, condition true అయిన మొదటి block ను మాత్రమే నడుపుతుంది.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.క్రమం ముఖ్యం! అతిపెద్ద range ను ముందుగా తనిఖీ చేయండి. temp >= 15 ముందు వస్తే, 40 కూడా "Pleasant" అని ప్రింట్ అవుతుంది.