社区
Java
帖子详情
method(String)问题
unrealwalker
2004-10-04 04:31:11
void go(String s){s="bbb";}
然后执行
String s="aaa";
go(s);
System.out.println(s);
为什么s没被更改?s不是对象引用吗?
...全文
89
5
打赏
收藏
method(String)问题
void go(String s){s="bbb";} 然后执行 String s="aaa"; go(s); System.out.println(s); 为什么s没被更改?s不是对象引用吗?
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
unrealwalker
2004-10-04
打赏
举报
回复
thx!
明白了~~方法通过引用操作对象,而"aaa"对象无从修改
flyforlove
2004-10-04
打赏
举报
回复
因为java的方法都是传值的,所以方法不会改变参数的值,
但是对有些对象的引用来说是可以改变其所指向对象的内容的,(但是引用的值不会改变)。
但是你这儿是String对象,像String,Integer这类对象是不可以改变其内容的。
unrealwalker
2004-10-04
打赏
举报
回复
不会改变参数内容的不是基本型别吗?
MaoZhua
2004-10-04
打赏
举报
回复
又是一个参数传递的问题:在方法内,不会改变参数的内容。
flyforlove
2004-10-04
打赏
举报
回复
java中Strin类型是不可以改变内容的。
相关推荐
hacktivoverflow-react:Stackoverflow看起来很像,使用react进行构建
服务器路由 /登录
Method
: Post Body: { username:
string
, password:
string
} /用户
Method
: Get / users /:id
Method
: Get / users /:iduser / panel
Method
: Get /用户/注册
Method
: Post Body: { email:
string
, username:
string
, password:
string
} /用户/登录
Method
: Post Body: { username:
string
, password:
string
} /
问题
Method
: Get / questions /:id
Method
: Get /
问题
Method
: Post Body: { user: strin
运行maven项目报错:The
method
queryForInt(
String
) is undefined for the type JdbcTemplate
报错:The
method
queryForInt(
String
) is undefined for the type JdbcTemplate The
method
JdbcTemplate.queryForInt was deprecated in Spring 3.2.2 and it was removed in Spring 4.2.0.
问题
:spring.jar包
问题
解决SpringBoot启动类报错can not resolve
method
‘run(java.lang.class,
String
[])‘
问题
解决SpringBoot启动类报错can not resolve
method
'run(java.lang.class,
String
[])'
问题
Cannot resolve
method
‘toCharArray‘ in ‘
String
‘
Cannot resolve
method
‘toCharArray’ in ‘
String
’
String
类中竟然没有了toCharArray方法,怎么回事啊,后面发现是导包的
问题
。 把这个删除走就可以了。
The
method
find(
String
, Object[]) is ambiguous for the type
异常描述: Multiple markers at this line - The
method
find(
String
, Object[]) is ambiguous for the type BaseDaoI - Line breakpoint:UserServiceImpl [line: 81] - combobox(
String
)
问题
解析:
发帖
Java
Java
Java相关技术讨论
复制链接
扫一扫
4.9w+
社区成员
8.5w+
社区内容
Java相关技术讨论
java
spring boot
spring cloud
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
帖子事件
创建了帖子
2004-10-04 04:31
社区公告
暂无公告