Advanced
Object-Oriented Programming Concepts
Q86 / 100
What is the difference between "structural subtyping" and "nominal subtyping"?
Correct! Well done.
Incorrect.
The correct answer is A) Structural subtyping determines compatibility based on the shape (members) of a type, while nominal subtyping requires an explicit declared relationship (e.g. extends/implements)
A
Correct Answer
Structural subtyping determines compatibility based on the shape (members) of a type, while nominal subtyping requires an explicit declared relationship (e.g. extends/implements)
Explanation
Languages like Go and TypeScript use structural typing (a type satisfies an interface if it has matching members), while Java and C# use nominal typing (a class must explicitly declare implements).
Progress
86/100