静态绑定self和static的区别
发表于
self示例
代码
1 | class Father |
运行结果
1 | son init.. |
从运行结果看,调用init非静态方法,父类的方法已经被子类覆盖了;但使用self调用test静态方法,使用的还是父类的静态方法。
static示例
代码
1 | class Father |
运行结果
1 | son init.. |
Hello World
发表于
1 | class Father |
1 | son init.. |
1 | class Father |
1 | son init.. |
发表于
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
1 | $ hexo new "My New Post" |
More info: Writing
1 | $ hexo server |
More info: Server
1 | $ hexo generate |
More info: Generating
1 | $ hexo deploy |
More info: Deployment