Skip to content

Commit 10d91a0

Browse files
committed
Update OperatorConditional.java
1 parent 5a3b045 commit 10d91a0

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Modul1Basic/Operator/src/com/dicoding/javafundamental/operator/OperatorConditional.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
public class OperatorConditional {
44

55
public static void main(String[] args) {
6-
int value1 = 4;
7-
int value2 = 5;
6+
int value = 4;
7+
int anotherValue = 5;
88

99
System.out.println("Conditional AND");
10-
boolean hasil = value1 == 3 && value2 == 5;
11-
boolean hasil2 = value1 != 3 && value2 == 5;
10+
boolean result = value == 3 && anotherValue == 5;
11+
boolean anotherResult = value != 3 && anotherValue == 5;
1212

13-
System.out.println("Hasil Operator AND pada syarat value1 == 3 dan value2 == 5 adalah " + hasil);
14-
System.out.println("Hasil Operator AND pada syarat value1 != 3 dan value2 == 5 adalah " + hasil2);
13+
System.out.println("Hasil Operator AND pada syarat value == 3 dan anotherValue == 5 adalah " + result);
14+
System.out.println("Hasil Operator AND pada syarat value != 3 dan anotherValue == 5 adalah " + anotherResult);
1515
System.out.println();
1616
System.out.println("Conditional OR");
1717

18-
hasil = value1 == 3 || value2 == 5;
19-
hasil2 = value1 != 3 || value2 == 5;
18+
result = value == 3 || anotherValue == 5;
19+
anotherResult = value != 3 || anotherValue == 5;
2020

21-
System.out.println("Hasil Operator AND pada syarat value1 == 3 dan value2 == 5 adalah " + hasil);
22-
System.out.println("Hasil Operator AND pada syarat value1 != 3 dan value2 == 5 adalah " + hasil2);
21+
System.out.println("Hasil Operator OR pada syarat value == 3 dan anotherValue == 5 adalah " + result);
22+
System.out.println("Hasil Operator OR pada syarat value != 3 dan anotherValue == 5 adalah " + anotherResult);
2323
System.out.println();
2424
}
2525
}

0 commit comments

Comments
 (0)