Lesson 19 of 34
Return Values
9 min 30 XP
Method ஒரு மதிப்பைத் திருப்பித் தர வேண்டுமெனில் void-க்கு பதிலாக அந்த type-ஐ (int, double, boolean, String) எழுதி return பயன்படுத்துங்கள். return இயங்கியவுடன் method முடிந்துவிடும்.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.நல்ல method ஒரே ஒரு வேலையைச் செய்யும், அதன் பெயர் அந்த வேலையைச் சொல்லும்: isPrime, findMax, calculateTax.