+ 11
What is difference between implicit and explicit in java?
4 Respuestas
+ 11
Explicit means somthing is done by the programmer
Implicit means that its done by the complier.
for example if you dont explicitly create a constructor for your class the compiler will implicitly create default one for you.
+ 8
D_Stark please give an example using programme.
+ 6
In general terms like these are used in type conversion
In implicit conversion the data type of the variable is converted to the highest data type (Hierachy ) present in the expression
For eg:
int a double b
c=a+b
In this the compiler will convert the value in double which is highest in expression
Explicit is forced conversion done using type cast operator for eg
int a double b
s=(int) a+b
In this the sum would be converted into int type
Hope it helps