С
public class SumTest {
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 main(String[] args) {
doSum(10, 20); // Integer sum is 30
doSum(10.0, 20.0); // Double sum is 30.0
doSum(10.0f, 20.0f); // Float sum is 30.0
}
}
The correct answer is the letter A, there is an overload of the methods. Here's the code:
public class Test {
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 main (String[] args) {
doSum(10, 20);
doSum(10.0, 20.0);
}
}
Answer is actually C
Integer sum is 30
double sum is 30.0
upvoted 1 times
...
...
This section is not available anymore. Please use the main Exam Page.1z0-808 Exam Questions
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.
din_sub077
4 weeks, 1 day agodin_sub077
4 weeks, 1 day agoMPignaProTech
5 months, 3 weeks agoaf8c3f3
6 months, 1 week agoSisar
7 months, 2 weeks agoGeradine
11 months, 1 week agoiSnover
2 years, 6 months agoyanoolthecool
1 year, 3 months ago