Week 14: Java Method Overloading, Java Scope, and Java Recursion Flashcards
It allows different methods to have the SAME NAME, but different signatures where the signature can differ by the number of input parameters or type of input parameters, or a mixture of both.
Method Overloading
Method overloading in Java is also known as:
Compile-time Polymorphism, Static Polymorphism, or Early binding.
In Method overloading compared to the parent argument, the ____ argument will get the highest priority.
child
With _________, multiple methods can have the same name with different parameters:
method overloading
Advantages of Method Overloading:
- Method overloading improves the Readability and reusability of the program.
- Method overloading reduces the complexity of the program.
- Using method overloading, programmers can perform a task efficiently and effectively.
- Using method overloading, it is possible to access methods performing related functions with slightly
different arguments and types. - Objects of a class can also be initialized in different ways using the constructors.
In Java, variables are only accessible inside the region they are created. This is called ________.
scope
Variables declared directly inside a method are available anywhere in the method following the line of code in which they were declared
Method Scope
It is the technique of making a function call itself.
Recursion
This technique provides a way to break complicated problems down into simple problems which are easier to solve.
Recursion
Every recursive function should have a
________, which is the condition where the function stops calling itself.
halting condition