Which two are true?

Given:
11. class A {
12. public void methodX(int i) { /* some code */ }
13. public String methodY(String s) { /* some code */ }
14. }
15. class B extends A {
16. public void methodX(int i) { /* some code */ }
17. public String methodX(String s) { /* some code */ }
18. public String methodY(String s) { /* some code */ }
19. }
Which two are true? (Choose two.)

Given:
11. class A {
12. public void methodX(int i) { /* some code */ }
13. public String methodY(String s) { /* some code */ }
14. }
15. class B extends A {
16. public void methodX(int i) { /* some code */ }
17. public String methodX(String s) { /* some code */ }
18. public String methodY(String s) { /* some code */ }
19. }
Which two are true? (Choose two.)

A.
The methodY(String) in class B overrides methodY(String) in class A.

B.
The methodY(String) in class B overloads methodY(String) in class A.

C.
The methodX(String) in class B overrides methodX(int) in class A.

D.
The methodX(int) in class B overrides methodX(int) in class A.

E.
The methodX(int) in class A overloads methodX(String) in class B.



Leave a Reply 0

Your email address will not be published. Required fields are marked *