What is widning and narrowing ?

Showing Answers 1 - 2 of 2 Answers

SURENDER REDDY B

  • Jun 28th, 2006
 

Widning and Narrowing will appear in the Casting operation. Widning is nothing but converting lower datatype to higher datatype when we cast the datatypes.Narrowing is nothing but converting higher datatype to lower datatype when we cast the datatypes. Higher to lower in the sence (lower) byte-short-int-long-float-double (higher) f                                                    (lower) char-int (higher)

  Was this answer useful?  Yes

manyam

  • Jun 29th, 2006
 

Narrowing: done by JVM automatically; won't give any compile time errorWidning: you have to cast explicity, otherwise compiler will throw an error (lpossible loss of precision)--Mani

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions