Lesson 7 of 34
else if: பல வழிகள்else if: Many Choices
8 min 25 XP
இரண்டுக்கு மேற்பட்ட வழிகள் இருந்தால் else if பயன்படுத்துங்கள். Java மேலிருந்து கீழாகச் சோதிக்கும்; முதலில் true ஆகும் பகுதி மட்டுமே இயங்கும்.
Use else if when there are more than two choices. Java checks from top to bottom and runs only the first block whose condition is true.
Example: edit me and press Run
Press Run to see the result here.வரிசை முக்கியம்! பெரிய மதிப்பை முதலில் சோதியுங்கள். temp >= 15 முதலில் இருந்தால் 40-ம் "Pleasant" என்று வரும்.
Order matters! Check the biggest range first. If temp >= 15 came first, even 40 would print "Pleasant".