Given:public class Frodo extends Hobbit{
public static void main(String[] args){
Short myGold = 7;
System.out.println(countGold(myGold,6));
}
}
class Hobbit{
int countGold(int x, int y){ return x+y ;}
}What is the result?
A. 13
B. Compilation fails due to multiple errors
C. Compilation fails due to an error on line 6
D. Compilation fails due to an error on line 7
E. Compilation fails due to an error on line 11哪位高手给下解答并且分析
public static void main(String[] args){
Short myGold = 7;
System.out.println(countGold(myGold,6));
}
}
class Hobbit{
int countGold(int x, int y){ return x+y ;}
}What is the result?
A. 13
B. Compilation fails due to multiple errors
C. Compilation fails due to an error on line 6
D. Compilation fails due to an error on line 7
E. Compilation fails due to an error on line 11哪位高手给下解答并且分析
System.out.println(countGold(myGold,6));编译错误