Java片段 Java中Double和Long互相转换

本文出自:http://blog.csdn.net/kookob/article/details/7199363

public class LongAndDouble {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		double d = 88.88;
		long l =<span style="color:#FF0000;"> Math.round(d);</span>
		System.out.println(l);
		
		long ll = 100L;
		double dd = (double) ll;
		System.out.println(dd);
	}

}

你可能感兴趣的:(Java片段 Java中Double和Long互相转换)