iOS interview output prediction #ios #coding #iosdevelopment #coding

preview_player
Показать описание
Most of the interviewers test your knowledge on protocol and extension. So this is the classical example of the protocol and extension usage and interview question for iOS developers.
Predict the output of the code snippet.......
Final Output: woof! woof! woof!
Explanation:
• The output "woof!" comes from the Dog class's bark() method, which overrides the default protocol extension's implementation.
• The output "woof! woof!" comes from the Corgi class, which further overrides the Dog class's bark() method.
• The default protocol extension implementation ("no barking") is not used because both Dog and Corgi provide their own specific bark() methods.
#ios #appledev #apple #iosdeveloperslife #mobile #interview #codeeffectively #code #programming #development
Рекомендации по теме
Комментарии
Автор

Most of the interviewers test your knowledge on protocol and extension. So this is the classical example of the protocol and extension usage and interview question for iOS developers.
Predict the output of the code
Final Output: woof! woof! woof!
Explanation:
• The output "woof!" comes from the Dog class's bark() method, which overrides the default protocol extension's implementation.
• The output "woof! woof!" comes from the Corgi class, which further overrides the Dog class's bark() method.
• The default protocol extension implementation ("no barking") is not used because both Dog and Corgi provide their own specific bark() methods.

codeeffectively