πŸ“Š PHP
Q. What will be the output?
Code:
interface A { public function test(); }
class B implements A { public function test() { echo 'OK'; } }
(new B())->test();
  • (A) OK
  • (B) Error
  • (C) Nothing
  • (D) A
πŸ’¬ Discuss
βœ… Correct Answer: (A) OK

Explanation: Class implements interface method.

Explanation by: Roshan
Class implements interface method.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
2
Total Visits
πŸ“½οΈ
8 d ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
94%
Success Rate