Lesson 20 of 34
Method Overloading
7 min 30 XP
Parameters ನ ಸಂಖ್ಯೆ ಅಥವಾ type ಬೇರೆಯಾಗಿದ್ದರೆ ಹಲವು methods ಒಂದೇ ಹೆಸರನ್ನು ಹಂಚಿಕೊಳ್ಳಬಹುದು. Java call ನೋಡಿ ಸರಿಯಾದದ್ದನ್ನು ಆರಿಸುತ್ತದೆ. ಇದನ್ನು 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.