与您可能假设的情况相反,即时优化不在创建实例时或方法运行时发生,而是在定义类的作用域内发生。
Contrary to what you might assume, just-in-time does not happen when an instance is created, or methods run, but rather in the scope where the class is defined.
您可以在代码的任何地方导入包、类等,它们的作用域限于导入它们的文件。
You can import packages, classes, etc. anywhere in the code, and they are scoped to where you import them.
静态函数与静态属性一样,作用域也是类而非该类的对象实例。
Static functions, like static properties, are scoped to the class rather than to object instances of that class.
应用推荐