You are here: Home / Topics / Program to explain Implicit in Java

Program to explain Implicit in Java

Filed under: Java on 2023-08-11 19:33:38

// Program to explain Implicit Conversion ( Automatic Type Conversion )

class ImplicitConversion
{
public static void main( String args[ ] )
{
 Int  i = 2;
 float  f = 12.33f;
 byte  b = 1; 
 double d = 124.097;

 double  res = ( i - b ) * ( d / f );  

 System.out.println( " Answer is = " + res );
}
}


Output:

Answer is = 10.064639153923036

About Author:
V
Vinay Kumar     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.