Tricky Interview Question : Pass null argument with method overloading of String and Object types

Опубликовано: 28 Сентябрь 2024
на канале: Naveen AutomationLabs
32,266
850

In this video, I have explained one tricky java interview question: Interview Question : Pass null argument with method overloading with String and Object types


In the case of null, null is valid for both string and object. So, which method will be called?

Object is a parent class and string is a child class. While resolving the overloading method, the compiler always uses the presidency for the child type argument. So, the compiler will call the method with the string argument.


~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
https://www.youtube.com/c/Naveen%20Au...

Follow me on my Facebook Page:
  / naveenqtpexpert  

Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
https://t.me/joinchat/COJqZUPB02r5sB7...

Naveen AutomationLabs Paid Courses:
Java & Selenium:
http://naveenautomationlabs.com/manua...

Java & API +POSTMAN + RestAssured + HttpClient:
http://naveenautomationlabs.com/selen...