Analyze the following code:
class Test {
public static void main(String[] args) {
System.out.println(xMethod((double)5));
}
public static int xMethod(int n) {
System.out.println("int");
return n;
}
public static long xMethod(long n) {
System.out.println("long");
return n;
}
}
发布于 2021-02-15 03:24:31
【单选题】 A The program displays int followed by 5 B The program displays long followed by 5 C The program runs fine but displays things other than given in a and b D The program does not compile