Given the following sample code:
public class Example5{
public float Twin(float a, float b) {...
}
public float Twin(float a1, float b1) { ...}
}
How can above code will be corrected without changing the 'method's name', 'type' & 'number' of argument?
1.by changing the name of the argument.
2.by changing the body (code between braces)
3.by changing name of the class
4.by putting one method into another subclass of this class
(4)
By putting one method into another subclass of this class, will correct this code. After this change overloading is converted into overriding.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.