Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Java code Question..?
public static int fiveEight( int a, double b )
{
return 5;
}
public static int fiveEight( double a, int b )
{
return 8;
}
If, for example, the statement fiveEight( 5.2, 3 ) was executed, would Java execute the second method to obtain the value 8? Or would an error occur?
2 Answers
- Anonymous1 decade agoFavorite Answer
it would match the two parameters with the appropriate method parameters,
so yes the second method would be called to recieve an 8
- Anonymous1 decade ago
The methods have different signatures, so it would compile and run.