You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A graph and another example like this, before applying it to the Fraction class, will make it clearer.
public class Main {
static void add(int a, int b) {
System.out.println("sum = " + (a + b));
}
static void add(double a, double b) {
System.out.println("sum = " + (a + b));
}
public static void main(String[] args) {
add(10, 2);
add(5.3, 6.2);
}
}
Activity
habibasorour commentedon Jul 22, 2026
A graph and another example like this, before applying it to the Fraction class, will make it clearer.
I added to my understanding of overloading with a simpler implementation, and then reading the implementation in Fraction.
Something else I think could be added is overloading due to the number of arguments added.