numberuseexample.java

来自「JAVA编程思想源代码 值得一下 很难找的」· Java 代码 · 共 53 行

JAVA
53
字号
package chapter7;

public class NumberUseExample {

	Integer itger, itger2;

	Double dou, dou2;

	Byte by;

	Long lon;

	Short sho;

	short sho3;

	Number num;

	String bst;

	public NumberUseExample() {
		itger = new Integer(5);
		itger2 = new Integer("5");
		dou = new Double(3);
		dou2 = dou;
		by = new Byte("2");
		lon = new Long("533");
		sho3 = 55;
		sho = sho3;
		num = new Float("4.4444");
		bst = by.toString();
	}

	public void print() {
		System.out.println("itger is equals to itger2 is "
				+ itger.equals(itger2));
		System.out.println("dou is equals to dou2 is  " + dou.equals(dou2));
		System.out.println("dou is " + dou);
		System.out.println("by to string is " + bst);
		System.out.println("lon is " + lon + " and in this type max is "
				+ Long.MAX_VALUE);
		System.out.println("sho is " + sho + " and sho is equals to shoe is "
				+ sho.equals(sho3));
	}

	public static void main(String[] args) {
		NumberUseExample u = new NumberUseExample();
		u.print();

	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?