Hi
we want to know that what is widening conversion and Narrowing conversion?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted May 13, 2012, 3:32 AM
For a primitive data types, a value narrower data type can be converted to a value of a broader data type without loss of information. This is called Widening conversion. For example an int is directly converted to a double without first having to convert it to a long and a float.
Converting from a broader data type to a narrower data type is called narrowing conversion, which can result in loss of information. For example conversion between char and byte and short are narrowing conversions. For example byte takes 8 bits, short takes 16 bits, int takes 32 bits, long takes 64 bits. Conversion of short to int or int to long is widening conversion and conversion of int to short is a narrowing conversion.
Please refer the below links
http://msdn.microsoft.com/en-us/library/k1e94s7e%28v=vs.80%29.aspx
http://www.java2s.com/Tutorial/Java/0040__Data-Type/TheWideningConversion.htm
Thanks