Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is method overloading?
Answer: Method overloading is the ability to define multiple methods in the same class with the same name but different parameters.

Example:

class Calculator {
 public function add($a, $b) {
 return $a + $b; 
} public function add($a, $b, $c) {
 return $a + $b + $c;
 } 
}
Is it helpful? Yes No

Most helpful rated by users:

©2026 WithoutBook