Discuss / Python / 类似C++里的static

类似C++里的static

Topic source

VincyChan4231

#1 Created at ... [Delete] [Delete and Lock User]

类似C++里的“类中的static成员变量/函数”

有1个类A,有4个对象a1,a2,a3,a4

static变量,a1,a2,a3,a4都能访问,共用1份

普通变量,a1,a2,a3,a4都能访问,彼此独立无关联,各有1份


  • 1

Reply