Skip to content

Commit ade9ad8

Browse files
committed
reviewed ch04
1 parent 02f85b9 commit ade9ad8

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

ch04/Conditional.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
public class Conditional {
55

66
public static void main(String[] args) {
7-
String fruit1 = "Apple";
8-
String fruit2 = "Orange";
9-
System.out.println(fruit1.equals(fruit2));
10-
117
int x = 17;
128
int n = 18;
139

@@ -29,13 +25,13 @@ public static void main(String[] args) {
2925
System.out.println("x is zero");
3026
}
3127

32-
if (x == 0) {
33-
System.out.println("x is zero");
28+
if (x > 0) {
29+
System.out.println("x is positive");
3430
} else {
35-
if (x > 0) {
36-
System.out.println("x is positive");
37-
} else {
31+
if (x < 0) {
3832
System.out.println("x is negative");
33+
} else {
34+
System.out.println("x is zero");
3935
}
4036
}
4137

ch04/Logarithm.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ public static void main(String[] args) {
2828
}
2929
}
3030
}
31-

0 commit comments

Comments
 (0)