Self
╱🚧 under construction
Last updated
Was this helpful?
╱🚧 under construction
Last updated
Was this helpful?
⟩ ⟩ ⟩ Self
在 的定義中:Self
指遵循該協定的具體型別 (concrete type)。
在 的定義中:Self
指該物件的具體型別,例如:當一個定義在 class A
中的方法(method) 裡面如果提到 Self
,那麼這個 Self
不一定指 A
,因為如果一個子類別 (subclass) class B
的物件 (透過的方式) 執行這個方法時,Self
指的是 B
。
⟩