0% found this document useful (0 votes)
21 views1 page

Method Overloading in Java Classes

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

Method Overloading in Java Classes

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

1.

Create a class to print an integer and a character with two methods having the
same name but different sequence of the integer and the character parameters.
For example, if the parameters of the first method are of the form (int n, char c),
then that of the second method will be of the form (char c, int n).

[Link] a class to print the area of a square and a rectangle. The class has two
methods with the same name but different number of parameters. The method for
printing area of rectangle has two parameters which are length and breadth
respetively while the other method for printing area of square has one parameter
which is side of square.

[Link] a class named 'PrintNumber' to print various numbers of different


datatypes by creating different methods with the same name 'printn' having a
parameter for each datatype.

You might also like