interface Go語言里面設(shè)計(jì)最精妙的應(yīng)該算interface,它讓面向?qū)ο?內(nèi)容組織實(shí)現(xiàn)非常的方便,當(dāng)你看完這一章,你就會(huì)被interface的巧妙設(shè)計(jì)所折服。 什么是interface 簡單的說,interface是一組method的組合,我們通過interface來定義對(duì)象的一組行為。 我們前面一章最后一個(gè)例子中Student和Employee都能SayHi,雖然他們的內(nèi)部實(shí)現(xiàn)不...
www.dbjr.com.cn/article/568...htm 2025-6-4