章节
问答
课签
笔记
评论
占位
占位

Java中的赋值运算符

赋值运算符是指为变量或常量指定数值的符号。如可以使用 “=” 将右边的表达式结果赋给左边的操作数。

Java 支持的常用赋值运算符,如下表所示:

任务

让我们赶紧来做个练习吧,亲...

请在编辑器中,空白处编写代码,应用赋值运算符实现如下结果:

?不会了怎么办

1、  要注意哦,如 “+=” 此类运算符中间一定是没有空格滴

2、  参考实现:

||
1
public class
    HelloWorld{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
提交
重置代码
||

请验证,完成请求

由于请求次数过多,请先验证,完成再次请求

加群二维码

打开微信扫码自动绑定

您还未绑定服务号

绑定后可得到

  • · 粉丝专属优惠福利
  • · 大咖直播交流干货
  • · 课程更新,问题答复提醒
  • · 账号支付安全提醒

收藏课程后,能更快找到我哦~

使用 Ctrl+D 可将课程添加到书签

邀请您关注公众号
关注后,及时获悉本课程动态

举报

0/150
提交
取消
全部 精华 我要发布

最新回答 / qq_慕函数1277288
字符串和变量的链接符号是+ System.out.println(" three = one + two ==>"+three);

最赞回答 / 慕先生5405824
你所有的System.out.println()中的()用的都是中文(),换成英文的()就对了。
exp{

    (String[] args) {

        one = ;

        two = ;

        three = ;

        three = one + two...

最新回答 / 從未停留
无意义,课程中就是表示 是这个  推导出 的意思

最新回答 / 慕先生2348631
public class HelloWorld{    public static void main(String[] args) {    int one = 10 ;        int two = 20 ;        int three=0;        three=one+two;        System.out.println("three=one+two==>"+three);        three+=one;        ((SYstm)).out.println(...

最新回答 / weixin_慕娘4490471
public class HelloWorld{    public static void main(String[] args) {     int one=10;        int two=20;        int three=0;            three = one+two;            System.out.println("three=one+two==>"+three);                three = three+=one;         ...

最赞回答 / qq_慕瓜2599115
int three=20;int one=10;"three+=one"表示"three=three+one",现在three的值已经发生改变为(20+10=30),three=30,接下来下一步用three计算,three应该用30这个值代入

最新回答 / 慕圣3139214
        int age1=three=one+two;        int age2=three+=one;        int age3=three-=one;        int age4=three*=one;        int age5=three/=one;        int age6=three%=one;        System.out.println("three=one+two==>"+age1);        System.out.println("t...

最新回答 / qq_慕仰9054617
if (num >= 0  && num<=999999999){while(num != 0){count++;num/=10;}System.out.println("它是个"+ count+"位的数!");} else{System.out.println("输入有误!");}

最新回答 / 慕标3571052
http://www.chinaso.com/newssearc ... F%E9%AA%91%7A%61%65https://s.liqucn.com/s.php?words ... 9%AA%91%7A%69%65%74http://www.chinaso.com/newssearc ... 9%AA%91%69%7A%70%67https://s.liqucn.com/s.php?words ... 0%8F%E9%AA%91%6E%6Chttp://www.chinaso.com/newssear...

最新回答 / 慕标1060215
<...code...>

最新回答 / java从0到神志不清
那个+three就是代码运行后 输出的值  换句话说就是给three赋的新值

最新回答 / 刘恩豪over
打印输出里必须要有变量的,运算不是变量

最新回答 / weixin_慕瓜2023752
因为加 int 是定义变量 你前面已经定义了three了 

最赞回答 / 慕婉清5250098
three %= one 意思是three除以one的余数赋值给three假如three=10,one=310除以3的余数是1,把1赋值给three
全部 我要发布
最热 最新
只看我的

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

账号登录 验证码登录

遇到问题
忘记密码

代码语言