网友您好, 请在下方输入框内输入要搜索的题目:
GivenafileGrizzlyBear.java: 1.package animals.mammals; 2. 3.public class GrizzlyBear extends Bear{ 4.voidhunt(){ 5.Salmons=findSalmon(); 6.s.consume(); 7.} 8.} and another file,Salmon.java: 1.packageanimals.fish; 2. 3.public class Salmon extends Fish{ 4.voidconsume(){/*dostuff*/} 5.} Assume both classes are defined in the correct directories for theft packages,and that the Mammal class correctly defines the findSalmon()method.Which two changes allow this code to compile correctly?()
- A、add public to the start of line 4 in Salmon.java
- B、add public to the start of line 4 in GrizzlyBear.java
- C、add import animals.mammals.*;at line 2 in Salmon.java
- D、add import animals.fish.*at line 2 in GrizzlyBear.java
- E、add import animals.fish.Salmon.*;at line 2 in GrizzlyBear.java
- F、add import animals.mammals.GrizzlyBear.*;at line 2 in Salmon.java
参考答案