by Dinesh Thakur

Type Conversion

 

Type Conversion is that which converts the one data type into another for example converting a int into float converting a float into double The Type Conversion is that which automatically converts the one data type into another but remember we can store a large data type into the other for ex we can t store a float into int because a float is greater than int Type Conversion is Also Called as Promotion of data Because we are Converting one Lower data type into higher data type So this is Performed Automatically by java  compiler

 

 

Type Casting

 

When a user can convert the one higher data type into lower data type then it is called as the type casting Remember the type Conversion is performed by the compiler but a casting is done by the user for ex converting a float into int Always Remember that when we use the Type Conversion then it is called the promotion when we use the type casting means when we convert a large data tote into another then it is called as the demotion when we use the type casting then we can loss some data. Like We are converting float into int then it will Truncate the Fractional part from the data  Like (int) 123.78 Will gives use only 123 this will Truncate the Fractional Part and Returns only Int value








About Us

Dinesh ThakurDinesh Thakur is a Columinist and designer with strong passion and founder of Computer Notes. if you have any ideas or any request Find Dinesh Thakur on
linkedin FaceBook Twitter Google Plus