Advertisement
MrsMcLead

Review - Operators

Feb 6th, 2014
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. public class Review
  2. {
  3.   public static void main(String []args)
  4.   {
  5.     //Java Operators
  6.    
  7.     int x;
  8.    
  9.     //the assignment operator "="
  10.     x = 10;
  11.     System.out.println(x);
  12.     // System.out.println(x);
  13.    
  14.     //addition
  15. //     x = x + 2;
  16. //     System.out.println(x);
  17. //     x+=2;
  18. //     System.out.println(x);
  19. //    
  20. //   // subtraction
  21. //    x = x - 5;
  22. //    System.out.println(x);
  23. //    x-=5;
  24. //    System.out.println(x);
  25. //    
  26. //    x = x * 3;
  27. //    x*=3;
  28.    
  29. //    x = x/5;
  30. //   x/=4;
  31.    
  32.     //modulus... we all say "mod"
  33.     //"x mod 4"
  34.    
  35.     // x = x%4;
  36.     // System.out.println(x);
  37.    
  38.    
  39.    
  40.     //System.out.println(x);
  41.   }
  42.  
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement