File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Modul1Basic/Operator/src/com/dicoding/javafundamental/operator Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 33public 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}
You can’t perform that action at this time.
0 commit comments