Lesson 9 of 34
switch: ಹಲವು values ನಿಂದ ಆಯ್ಕೆ
8 min 30 XP
switch ಒಂದು value ಆಧರಿಸಿ ಹಲವು ಮಾರ್ಗಗಳಲ್ಲಿ ಒಂದನ್ನು ಆರಿಸುತ್ತದೆ. ಪ್ರತಿ case ಕೊನೆಯಲ್ಲಿ break ಬೇಕು, ಇಲ್ಲದಿದ್ದರೆ ಮುಂದಿನ case ಕೂಡ ಓಡುತ್ತದೆ (fall-through). ಏನೂ ಹೊಂದದಿದ್ದರೆ default ಓಡುತ್ತದೆ.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.switch String ಮತ್ತು char values ಜೊತೆಗೂ ಕೆಲಸ ಮಾಡುತ್ತದೆ. ಇಲ್ಲಿದೆ ಒಂದು ಚಿಕ್ಕ calculator.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.