Computer Science, asked by manvisushma, 7 months ago

computer
java
state the type of conversion
int b='A';
kindly reply if u know the answer
option 1 implicit
option 2 explicit
DON'T GIVE UNNECESSARY ANSWERS AS IT MAY BE EXPLICIT OR IMPLICIT ( WITH A DOUBTFUL MIND)​

Answers

Answered by Anonymous
0

It's explicit

Implicit conversion.

This type of conversion happens automatically by the compiler.

Double > Long > Float > Int > Short > Byte.

The conversion always gives priority to a greater data type. The above list is in a descending order, i.e., double is the data type given the first priority, then long, and so on. For Example :- when you so some operation on int and double, the answer will always be of double data type.

(int * float) / (double / int) + long -> Double.

In the first bracket, the answer is of float data type. In the second one, of double data type. Then during addition of float, double and long, double is the greatest, hence the complete answer is converted automatically in double.

Explicit conversion.

In this type of conversion, the programmer deliberately converts the answer or variable in a specific data type of his choice. For example :-

((int * float) / (double / int) + long)(int) -> Int.

In this case, the answer is found in double data type just like the last example, but because of explicitly converting the answer into int, the answer will be of int data type.

Similar questions