Venciity

[Java] Statements

May 2nd, 2014
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1.  
  2. public class Statements {
  3.  
  4.     public static void main(String[] args)
  5.     {
  6.         int r = (150-20) / 2 + 5;
  7.        
  8.         double surFace = Math.PI*r*r;
  9.        
  10.         double perimeter = 2 * Math.PI*r;
  11.        
  12.         System.out.println(r);
  13.         System.out.println(surFace);
  14.         System.out.println(perimeter);
  15.        
  16.         System.out.println();
  17.        
  18.         int a = 5;
  19.         int b = ++a;
  20.        
  21.         System.out.println(a); //6
  22.         System.out.println(b); //6
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment