Tuesday, November 29, 2011

Can a double value be cast to a byte?

Yes, a double value can be cast to a byte.:No a Double value cannot be casted to a byte.because capacity of byte is 1 byte & double is 8 bytes.If a double value is casted to byte then there will be the loss of information.:No a Double value cannot be casted to a byte.because capacity of byte is 1 byte. & double is 8 bytes.if a double value is casted to byte ,then there will be loss of information.:syntactically a double can be cast to a byte. but there will be loss of data:yes we can cast a double value to byte by explicitly casting but it may lost original vale if it passes the capacity of byte:yes we can cast a double value to byte by explicitly casting but it may lost original vale if it passes the capacity of byte
Category:Java Interview Questions

No comments:

Post a Comment