Richa Sharma wrote:Will byte b = 127 compile?
Kathy Sierra Book says yes java 127 will be implicitly cast to byte.
But the program gave compilation error when I used Eclipse and JDK6.
As Ankit said, it should compile, as 127 is still in range of byte.
Eclipse compiler is buggy in some aspects, although such a simple case as above should be no problem. To get "standard" results, compile and run from command line. My experience is that
IDE's compilers (not only Eclipse) aren't something
you should fully rely on.