Oracle
1Z0-819 · Question #129
Which of the following pairs of methods satisfy overloading rules?
The correct answer is A. public void check0(Throwable t) { and public int check0(Exception e) { return 0; } B. public void check1(String() s1) { and public void check1(String s2) { } F. public void check5(int() i) { and public void check5(Integer i2) { }. See the full explanation below for the reasoning.
Question
Which of the following pairs of methods satisfy overloading rules?
Options
- Apublic void check0(Throwable t) { and public int check0(Exception e) { return 0; }
- Bpublic void check1(String() s1) { and public void check1(String s2) { }
- Cpublic var check2(List<String> l) { and public var check2(Double s) { }
- Dpublic boolean check3(Float f1) { and public void check3(Float f2) { }
- Epublic void check4(List<Boolean> b) { and public void check4(List<Character> c) { }
- Fpublic void check5(int() i) { and public void check5(Integer i2) { }
How the community answered
(54 responses)- A81% (44)
- C11% (6)
- D2% (1)
- E6% (3)
Community Discussion
No community discussion yet for this question.