/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Object object = Integer.valueOf(1234);
		
		int result2 = (int)object; //works fine
		System.out.println("r2: " + result2);
		int result1 = int.class.cast(object); //throws ClassCastException: Cannot convert java.lang.integer to int
		System.out.println("r1: " + result1);
	}
}