โ Back to Interfaces
Question 627
Check the Interface Type With is
Check the Interface Type With is
Complete theInspector.Describemethod so it returnschargeablewhen the given object implements theIChargeableinterface andnot chargeableotherwise. Use theisoperator. Do NOT write aMainmethod. For aPhone(which isIChargeable) the program prints: chargeable For a plain string it prints: not chargeable
Expected Output:
chargeable
Topics:
Interfaces
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.