System.out.println("13" + 5 + 3);
时间: 2024-06-06 11:08:01 浏览: 19
This code will result in a compilation error because there are no commas separating the three arguments in the println method. It should be written as:
System.out.println("13" + 5 + 3);
This will output the string "135" because the + operator is used for concatenation when at least one operand is a string.
相关问题
如下是一段 Spring 代码: Flux.range(1, 10).__(2).subscribe(x-> System.out.print(x+" ")); System.out.println(); Flux.range(1, 10).__(2).subscribe(x-> System.out.print(x+" ")); System.out.println(); Flux.range(1, 10).__(i -> i < 5).subscribe(x-> System.out.print(x+" ")); System.out.println(); Flux.range(1, 10).__(i -> i == 6).subscribe(x-> System.out.print(x+" ")); 若你想要要想输出下列结果: 1 2 9 10 1 2 3 4 1 2 3 4 5 6
可以将代码修改为以下形式:
```
Flux.range(1, 10).take(2).subscribe(x-> System.out.print(x+" "));
System.out.println();
Flux.range(1, 10).takeLast(2).subscribe(x-> System.out.print(x+" "));
System.out.println();
Flux.range(1, 10).takeWhile(i -> i < 5).subscribe(x-> System.out.print(x+" "));
System.out.println();
Flux.range(1, 10).filter(i -> i <= 6 && i >= 1).subscribe(x-> System.out.print(x+" "));
```
输出结果为:`1 2 9 10 1 2 3 4 1 2 3 4 5 6`
system.out.println(b+a);
This code will result in a compilation error as there is no operator between "b" and "a". It should be written as:
System.out.println("b" + "a");
This will print the string "ba" to the console.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)