/**
 * {@link <a href=
 * "https://[Log in to view URL]"
 * target="_blank">wrapper class di un numero intero</a>}
 * 
 * @author itammb ( Italia Massimiliano Buscati )
 * @version JDK 1.15
 *
 */
class Main {
	/**
	 * @see Integer#valueOf(int i)
	 *
	 */
	public static void wrapperClassNum() {
		int num = 1;
		int numOther = 2;

		Integer wrapperNum = Integer.valueOf(num);
		Integer wrapperNumOther = Integer.valueOf(numOther);

		if (num == numOther)
			System.out.println(num + " == " + numOther);
		else
			System.out.println(num + " != " + numOther);

		// solo per il wrapper di data-type numerici
		if (wrapperNum == wrapperNumOther)
			System.out.println(wrapperNum + " == " + wrapperNumOther);
		else
			System.out.println(wrapperNum + " != " + wrapperNumOther);

		if (wrapperNum.equals(wrapperNumOther))
			System.out.println(wrapperNum + " == " + wrapperNumOther);
		else
			System.out.println(wrapperNum + " != " + wrapperNumOther);

		System.out.println("massimo valore di tipo int -> " + Integer.MAX_VALUE);
		System.out.println("minimo valore di tipo int -> " + Integer.MIN_VALUE);
	}
    
    public static void main(String[] args) {
        // Unit test - wrapper class di un numero intero
		wrapperClassNum();
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: