import java.util.Scanner;
import java.io.*;

public class ClassCast_Caught
{
   //-----------------------------------------------------------------
   //  Deliberately try to cast one class to another to cause an exception.
   //-----------------------------------------------------------------
   public static void main (String[] args)
   {
		try
		{
		   Object x = new Integer(0);
                   System.out.println((String)x);
		}
		catch(ClassCastException e)
		{
			System.out.println ("Caught a ClassCastException.");
		}
		finally 
		{
			System.out.println ("This text will be printed.");
		}
   }
}
