单项选择题

Given:
1. import java.util. *;
2. class Radio {
3. String getFreq() {return "97.3"; }
4. static String getF() {return "97.3"; }
5. }
6. vclass Ham extends Radio {
7. String getFreq() {return "50.1"; }
8. static String getF() {return "50.1"; }
9. public static void main(String[] args) {
10. List<Radio> radios = new ArrayList<Radio>();
11. radios.add(new Radio());
12. radios.add(new Ham());
13. for(Radio r: radios)
14. System.out.print(r.getFreq() + " " + r.getF() + " ");
15. } }
What is the result

A.50.1 50.1 50.1 50.1
B.50.1 97.3 50.1 97.3
C.97.3 50.1 50.1 50.1
D.97.3 97.3 50.1 50.1
E.97.3 97.3 50.1 97.3
F.97.3 97.3 97.3 97.3
G.Compilation fails.
H.An exception is thrown at runtime.
题目列表

你可能感兴趣的试题

微信扫码免费搜题