Given the following code, which method declarations can be inserted at line 1 without any problems?
public class OverloadTest{
public int sum(int i1, int i2) { return i1 + i2; }
// 1
}
Select 3 options
A. public int sum(int a, int b) { return a + b; }
B. public int sum(long i1, long i2) { return (int) i1; }
C. public int sum(int i1, long i2) { return (int) i2; }
D. public long sum(long i1, int i2) { return i1 + i2; }
E. public long sum(int i1, int i2) { return i1 + i2; }
If you want to solve the questions together with the experts and understand the concepts better, please contact us using the contact form or WhatsApp numbers. Selected people get to do that without any additional charges.