赋值运算符

来源:3-3 Java中的赋值运算符

qq_最后的需要_0

2015-04-28 13:36

public class HelloWorld{
    public static void main(String[] args) {
     int one = 10 ;
        int two = 20 ;
   
        int three=one+two;
        int three+=one;
       System.out.println(three);错误是这个  error: ';' expected
       int three += one ;
                ^
error: not a statement
       int three += one ;
                    ^
2 errors

写回答 关注

1回答

  • 晕_代码
    2015-04-28 21:05:09

    你已经一个 int three 了,把第二个 int three换一个名字

Java入门第一季(IDEA工具)升级版

0基础萌新入门第一课,从Java环境搭建、工具使用、基础语法开始

1163373 学习 · 17551 问题

查看课程

相似问题