- public class Eval { //创建类
- public static void main(String[] args) {//主方法
- int a, b, c; //声明int行变量a,b,c
- a = 15; //将15赋值给变量a
- c = b = a + 4; //将a+4的和赋值给变量b,然后再赋值给变量c
- a += 1; //将变量a的值加1,然后再赋值给变量a
- System.out.println("c值为:" + c); //将变量c的值输出
- System.out.println("b值为:" + b); //将变量b的值输出
- System.out.println("a值为:" + a); //将变量a的值输出
- }
- }
复制代码 |
|