We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02f85b9 commit ade9ad8Copy full SHA for ade9ad8
2 files changed
ch04/Conditional.java
@@ -4,10 +4,6 @@
4
public class Conditional {
5
6
public static void main(String[] args) {
7
- String fruit1 = "Apple";
8
- String fruit2 = "Orange";
9
- System.out.println(fruit1.equals(fruit2));
10
-
11
int x = 17;
12
int n = 18;
13
@@ -29,13 +25,13 @@ public static void main(String[] args) {
29
25
System.out.println("x is zero");
30
26
}
31
27
32
- if (x == 0) {
33
- System.out.println("x is zero");
28
+ if (x > 0) {
+ System.out.println("x is positive");
34
} else {
35
- if (x > 0) {
36
- System.out.println("x is positive");
37
- } else {
+ if (x < 0) {
38
System.out.println("x is negative");
+ } else {
+ System.out.println("x is zero");
39
40
41
ch04/Logarithm.java
@@ -28,4 +28,3 @@ public static void main(String[] args) {
0 commit comments