static error
来源:互联网 发布:bootrepair修复ubuntu 编辑:程序博客网 时间:2024/04/30 12:25
错误提示:'static' should not be used on member functions defined at file scope
问题原因:static 不能在文件区域内定义,也就是说不能在类里面定义,必须先在类里面声明然后在类外定义,定义时不需要加static关键字,
static 类型的成员函数,在定义时也不需要再加static关键字。
我的错误是在构造函数中给static变量赋了值,导致错误。
static类型的变量是属于类的,而不是仅属于某个对象的,该类的所有对象都可以调用它,类也可以调用。对象可调用它,但不是独占。所以不可以在类中对其定义,更不可以在构造函数中为其赋值,这样,每个对象的static值都会不同,是不符合条件的。
0 0
- static error
- Error starting static Resources
- Error starting static Resources
- Error starting static Resources
- Error starting static Resources
- Error starting static Resources ......
- Error starting static Resources
- Error starting static Resources
- 严重: Error starting static Resources
- 严重: Error starting static Resources
- Error starting static Resources 问题
- TOMCAT问题;严重: Error starting static Resources
- Error starting static Resources 错误的解决
- static 成员未初始化引起 error lnk2001
- TOMCAT问题;严重: Error starting static Resources
- django 1.5 static files 404 error
- Tomcat启动异常:Error starting static Resources
- Error starting static Resources java.lang.IllegalArgumentException
- 在java开发中date()与canlendar()的详解
- java学习笔记(2)
- 的飒飒规范化广泛交换看法规定
- [Java教程]-Java基础语法介绍
- 【Hibernate步步为营】--关联映射之多对一
- static error
- 内存泄露与内存溢出
- java学习笔记(3)
- 关于cocos2dx手游lua文件加密的解决方案
- 密码被更改导致无法登录的解决方法
- 线程总结
- 概率图模型(PGM)学习笔记(一)动机与概述
- iOS—应用内打开App Store应用详情界面
- bat 文件制作成exe文件并去掉dos黑窗口