Answer is B, i tested. Trie it:
public class Main {
public static void doSum(Integer x, Integer y) {
System.out.println("Integer sum is " + (x + y));
}
public static void doSum(double x, double y) {
System.out.println("Double sum is " + (x + y));
}
public static void doSum(float x, float y) {
System.out.println("Float sum is " + (x + y));
}
public static void doSum(int x, int y) {
System.out.println("Int sum is " + (x + y));
}
public static void main(String[] args) {
doSum(10, 20);
doSum(10.0, 20.0);
}
Correct answer should be B as overloaded methods have int and double argument types
upvoted 4 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
iSnover
Highly Voted 2 years, 3 months agoMPignaProTech
Most Recent 3 months agofvelazqueznava
1 year, 3 months agosomrita90
1 year, 4 months agoIbrahimAlnutayfi
1 year, 6 months agoVicky_65
1 year, 9 months agocarloswork
2 years, 2 months agokkaayyyy
2 years, 3 months agopraroopgupta
2 years, 3 months ago