Skip to content

Adding clarifying graphsfor method overloading #194

Open

Description

@habibasorour

Description

I think some graphs showing how the method of overlapping works would be great, with a comparison and contrast of the differences that result.

Screenshot

Image

Activity

  1. habibasorour commented on Jul 22, 2026

    @habibasorour
    ContributorAuthor

    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);
        }
    }
    
    

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions