Access Levels
Last updated
Last updated
Link tham khảo:
Cả 2 keywords trên đều cho phép chúng ta truy cập nó từ bên trong target nơi nó được define (define module) và cả bên ngoài - những module khác.
open: classes and class members can be subclassed and overridden both within and outside the defining module (target).
public: classes and class members can only be subclassed and overridden within the defining module (target). Allow members from other modules to use them, but NOT to override them
Chỉ cho phép chúng ta truy cập nó từ bên trong target nơi nó đực define (define module). Là default level, nếu không khai báo access level => mặc định là internal
Chỉ được truy cập trong cùng 1 file code.
Chỉ được truy cập trong cùng 1 class (bao gồm extensions trong cùng 1 file với class đó)
Extensions khác file cũng không truy cập được