Answer: Yes. The following code compiles and runs with no problem.

public class question2
{
   public static void main (String arg[])
   {
      int a = 10;
      double b;
      
      b = (double)a;
      System.out.println(b);
   }
}