Scratch | Java | |
---|---|---|
![]() |
public static void main ( String args [ ] ) } |
|
![]() |
int score; | |
![]() |
score = 0; | |
![]() |
score --; score = score -1; score -= 1; |
|
![]() |
score ++; score = score + 1; score += 1; |
|
![]() |
java.lang.System.out.print (score); | |
![]() |
java.lang.System.out.print ( "Hello!" ); | |
![]() |
( numeric value + numeric value ) ( numeric value - numeric value ) ( numeric value * numeric value ) ( numeric value / numeric value ) |
|
![]() |
( numeric value % numeric value ) | |
![]() |
java.lang.Math.round ( numeric value ) | |
![]() |
java.lang.Math.abs ( numeric value ) | |
![]() |
to pick a number between 0 and 1: to pick a number between 0 and j: ( Since by default Java uses decimals here rather than whole numbers, the round method shown above could be useful. ) |
|
![]() |
try { |
|
![]() |
( boolean value < boolean value ) ( boolean value > boolean value ) |
|
![]() |
( boolean value == boolean value ) | |
![]() |
( ! boolean value ) | |
![]() |
( boolean value && boolean value ) | |
![]() |
( boolean value || boolean value ) | |
![]() |
while ( ! condition ) { } |
|
![]() |
for ( int i = 0; i < 9 ; i++ ) { } |
|
![]() |
while ( true ) { } |
|
![]() |
if ( condition ) { } |
|
![]() |
if ( condition ) { } else { } |
|
![]() |
java.lang.System.exit ( 0 ); | |