Overloading2 Program
Description
This program demonstrates the concept of method overloading.Associated Concepts:
Method overloading
Algorithm:
There are three overloaded methods in this program.
They have the same name displayLine, but different signatures.
The first method has no parameter.
The second method has one parameter.
The third method has two parameters.
The second method has one parameter.
The third method has two parameters.
main method:
Write two method definitions
Call the first displayLine method and pass no
argument
Call the second displayLine method and pass only one argument
Call the third computeArea method and pass two arguments
Call the second displayLine method and pass only one argument
Call the third computeArea method and pass two arguments
Write two method definitions
The first displayLine method
prints the character "*" 10 times.
The second displayLine method prints the passed character parameter 10 times.
The third displayLine method prints the passed character parameter n times, where n is also passed as the parameter.
The second displayLine method prints the passed character parameter 10 times.
The third displayLine method prints the passed character parameter n times, where n is also passed as the parameter.