> For the complete documentation index, see [llms.txt](https://chihaolu.gitbook.io/all-in-one-solidity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chihaolu.gitbook.io/all-in-one-solidity/part-ii-medium/chapter-11-ji-cheng-inheritance/polymorphism.md).

# 【Polymorphism】

還記得在第五章時提到的FunctionOverloading以及前一章節提到的FunctionOverriding嗎，其實Polymorphism在繼承中最主要的兩種形式FunctionPolymorphism和ContractPolymorphism便分別指稱了以上兩項內容。

FunctionPolymorphism指的是在同一個合約中，宣告相同的函式名稱，藉由不同的參數內容來決定我們呼叫之後，程式碼最終使用的是哪段函式內容，也就是FunctionOverloading。

ContractPolymorphism指的是在不同合約中，宣告相同的函式名稱，藉由繼承之間的定義來決定我們呼叫之後，程式碼最終使用的是哪段函式內容，也就是FunctionOverriding。
