Tuesday 23 January 2018

simple java programs

public class Hello {
  // start attributes
 
 
  // end attributes
  // start methods
   public static void main(String argu[]) {
  

   char c = 'a';
   c++;
       System.out.println("the value of c is="+ c);
      
       double y =  (3/5);
       System.out.println(y);
      
        System.out.println('b');
        //System.out.println ((char)('b' + 'c'));
        System.out.println((char) ('a' + 4));

         int a = 2 * '1';
         System.out.println(a);
      
       //boolean b = 1;
       boolean f = true;
      // boolean d = "true";
       //boolean e = True;
       int i =1;       int x=0;        x= ++i * i + ++i * i;   System.out.println(x);
       int j =2;        x=0;          x= ++j * ++j -  j * j;  System.out.println(x);
       int k =2;        x=0;          x= ++k * k * ++k ;        System.out.println(x);
       int l =2;       x=0;          x= ++l * l + ++l ;        System.out.println(x);
       System.out.println("\"");
      



      
   }
  // end methods
}

0 comments: