Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Refactoring for Software Design Smells: Managing Technical Debt
this week in the
OO, Patterns, UML and Refactoring
Joined: Feb 10, 2006
Aug 22, 2006 10:24:00
I want to that why in
we can't do type casting from higher datatype to lower dataype.I mean
What exactly happens here at at memory level.Is it because of the two different way bot the data type are represented internally.If yes.. can someone pls explain it.
Joined: Aug 22, 2006
Aug 22, 2006 10:36:00
Please note that you are not doing a cast from a float to an int, you are just trying to assign a float to an int.
The correct option would be:
And then i=2.
Have you checked out
subject: type casting
why ceil & floor accepts int
primitive type casting problem.........
converting float to double
Float a=3 doesn't compile but Short a=3 does. Why ?
Casting & Conversion !
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015