public class Example3
{
String str;
public Example3(String str)
{
this.str=str;
System.out.println(this.str);
}
public static void main(String[] args)
{
final Example3 one=new Example3("Hello");
one=new Example3("hello world");
}
}
{
String str;
public Example3(String str)
{
this.str=str;
System.out.println(this.str);
}
public static void main(String[] args)
{
final Example3 one=new Example3("Hello");
one=new Example3("hello world");
}
}
解决方案 »
- JAVA快捷键
- 诚心请教jacob问题。。。。。。。。。。。。。。。。。。
- 怎么会出现:警告:<applet> 标记需要高度属性
- 关于java中的HTML.Tag,在线等!!!
- 用javamail,怎么能知道收到邮件的编码格式
- 如何用java实现拖拽??
- 【请问】市面上有什么好书是来介绍在linux下面开发java程序的吗
- 请教JAVA包的问题?
- [原创]服务器上的一个文本方式的配置文件,服务器上的java applet程序要访问它,得到配置文件中的信息,然后放在tomcat下供客户端浏览。
- 安装问题,不难?即答即结!
- 新手的疑问!排徊在j2ee与asp.net之间
- 如何用swing的布局实现简单的查询界面
你前面final Example3 one=new Example3("Hello");已经把one就成不可变的了
后面one=new Example3("hello world");又想改变one里的值当然是不行的了。
想不出错把final去掉,不过我不知道你想干什么
谢谢各位的支持!
小弟在这里谢了!!
所以one=new Example3("hello world");这句话不能用.