As part of this topic let us see how to override functions and operators

- As explained earlier all operators are functions
- We can define functionality to any of the operators like any function
- If you want to change the functionality of == override equals

## Task – Overriding or implementing functions

- Create class Fraction which take 2 constructor arguments numerator and denominator
- Override toString function to print in the form of numerator/denominator
- Create function result which will return the double by dividing numerator with denominator
- Implement + to add 2 fractions and return new fraction applying formula of adding 2 fractions
- First fraction f = n1, d1
- Second fraction s = n2, d2
- f + s = ((n1 * d2) + (n2 * d1)), (d1 * d2)
- toString = print n1/d1
- result = actual result after performing n1/d1
- Develop main function to validate

## Exercise – Override other operators

- Implement – to subtract one fraction from other fraction and return new fraction applying formula of subtracting 2 fractions
- f – s = ((n1 * d2) – (n2 * d1)), (d1 * d2)

- Implement * to multiply 2 fractions
- First fraction f = n1/d1
- Second fraction s = n2/d2
- f * s = (n1 * n2), (d1 * d2)

- Implement / to divide 2 fractions
- First fraction f = n1/d1
- Second fraction s = n2/d2
- f / s = (n1 * d2), (n2 * d1)

## Start the discussion at discuss.itversity.com