โ Back to Interfaces
Question 614
A Factory That Returns an Interface
A Factory That Returns an Interface
Complete the static methodShapeFactory.Create(string kind). Whenkindis"circle"it returns a newCircle; for anything else it returns a newSquare. The return type is the interfaceIShape. Do NOT write aMainmethod. ForCreate("circle")the program prints: circle
Expected Output:
circle
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.