implicit casting in Java?

What is implicit casting in Java?
Answer:
Implicit casting:
It is the process of simply assigning one entity to another without any transformation guidance to the compiler.
The compiler will convert and store the datatype accordingly.
This type of casting is not permitted in all kinds of transformations and may not work for all scenarios.

Check the example below:
int i = 20;
long j = i; //Here we are doing Implicit casting

0 comments:

Post a Comment