Lesson 20 of 34
Method Overloading
7 min 30 XP
Parameters-ന്റെ എണ്ണമോ type-ഓ വ്യത്യസ്തമാണെങ്കിൽ പല methods-ന് ഒരേ പേര് ഉപയോഗിക്കാം. Call നോക്കി Java ശരിയായത് തിരഞ്ഞെടുക്കുന്നു. ഇതിനെ compile-time polymorphism എന്ന് വിളിക്കുന്നു, ഒരു ക്ലാസിക് interview പദം.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.Return type മാത്രം മാറ്റുന്നത് overloading അല്ല; അത് compile error ആണ്.