KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > DoubleToShort


1 public class DoubleToShort {
2
3     public static void main(String JavaDoc[] args) {
4         double x = 9876543210.0;
5         short y = (short)x;
6         System.out.println(y);
7         short s = 9876;
8         double d = (double)s;
9         System.out.println(d);
10     }
11 }
12
13
Popular Tags