转:Cannot make a static reference to the non-static解决办法
来源:互联网 发布:网络服务器拓扑图标 编辑:程序博客网 时间:2024/05/21 13:55
今天用java封装了一个方法后,再在其它函数调用的时候,报了题目的错误。
具体是String res=一个method的return,虽然return也是string,但是java会报错。解决办法是 在赋值前添加代码:Segmentimprove gp=new Segmentimprove();//类的实例化
其中Segmentimprove是java类的类名,也就是首先要把类实例化,这样method返回的string在内存中就有了存储位置。
具体请参考:http://blog.csdn.net/aeolus1019/article/details/7974430
0 0
- 转:Cannot make a static reference to the non-static解决办法
- Cannot make a static reference to the non-static method
- Cannot make a static reference to the non-static method
- Cannot make a static reference to the non-static field
- Cannot make a static reference to the non-static method
- Cannot make a static reference to the non-static field
- (转)Cannot make a static reference to the non-static method
- Cannot make a static reference to the non-static method setInAnimation(Animation) from the type View
- Cannot make a static reference to the non-static method getLocalActivityManager() from the type Acti
- Cannot make a static reference to the non-static method xxx()
- Cannot make a static reference to the non-static method的解决方法
- java.lang.Error: Unresolved compilation problem: Cannot make a static reference to the non-static
- 泛型类与静态泛型方法 Cannot make a static reference to the non-static type
- ava错误Cannot make a static reference to the non-static method
- Cannot make a static reference to the non-static method的解决方法
- Cannot make a static reference to the non-static method的解决方案
- 自学JAVA之Cannot make a static reference to the non-static method分析
- Cannot make a static reference to the non-static method的解决方法
- JAVA 根据设置的概率生成随机数
- 水仙花数
- MPEG I B P 帧
- 利用sys.sysprocesses检查SqlServer的阻塞和死锁
- APT问题
- 转:Cannot make a static reference to the non-static解决办法
- 记录:编译Qt5.0连接MySql5.5数据库的驱动
- u-boot之u-boot-2009.11启动过程分析
- 博弈论入门小结
- 程序设计的加密设计
- struts2 下载Excel
- Web性能压力测试工具之ApacheBench(ab)详解
- java中文转换为拼音的pinyin4j学习笔记
- c++_孙鑫mfc视频02_学习