Programming Examples
Java program to design a class to overload a function compare for int char and string
Design a class to overload a function compare() as follows:
(a) void compare(int,int) - to compare tow integer values and print the greater of the tow integers.
(b) void compare(char,char) - to compare the numeric value of tow character with higher numeric value.
(c) void compare(String,String) - to compare the length of the tow strings and print the longer of the two.
Output