Question OOP-POLY-0072
HardIn Java, given void f(Object o) and void f(String s), which runs for f((Object) "hi")?
- A.
f(String s)
- B.
Compilation error
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Polymorphism question
In Java, given void f(Object o) and void f(String s), which runs for f((Object) "hi")?
f(String s)
Compilation error
Sign up free to see the answer and a step-by-step explanation.
Both
f(Object o)