Java中的数字


Java中的数字

public class DemoJava {

   public static void main(String []args) {

      short  s;
      int    i;
      long   l;
      float  f;
      double d;

      s = 10;
      i = 1000;
      l = 1000000L;
      f = 230.47f;
      d = 30949.374;

      System.out.format( "s: %d\n", s);
      System.out.format( "i: %d\n", i);
      System.out.format( "l: %d\n", l);
      System.out.format( "f: %f\n", f);
      System.out.format( "d: %f\n", d);

   }
}