ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is the method of Overloading in Java?

user-image
تم إضافة السؤال من قبل salma samreen , Quality Assurance Engineer , Private Limited
تاريخ النشر: 2016/02/06

Since reusability is the best process for anything, so JAVA also give us an option to reuse our resources in a given program.

Overloading in JAVA simply means to reuse the same method or fuction name in a class but with different arguements.

Internal process is pretty simple. Whenever we call a method / function in JAVA the compiler only checks the name and arguement.

مستخدم محذوف‎
من قبل مستخدم محذوف‎

Overloading in JAVA is the ability given to a class to have several methods with the same name but with different number of parameters or different parameters data types. 

Overloading works as well with the constructor, called constructor overloading which allows a class to have several constructors with different argument lists. 

Both type of overloading are part of static polymorphism. 

 

Overriding and Overloading must not be confused. 

المزيد من الأسئلة المماثلة