Home / Questions / What are the types of casting shown by the following examples? double x = 15.2;int y = (int) x; int x = 12;long y = x;
Explanatory Question

What are the types of casting shown by the following examples?

  1. double x = 15.2;
    int y = (int) x;

  2. int x = 12;
    long y = x;

👁 84 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

  1. Explicit Type Casting
  2. Implicit Type Casting