Will this code be compiled?

long x = 5; 
long y = 2;
byte b = (byte) x / y;
Explanation
Ti make it compile you need to change order of operations like this: byte b = (byte)(x/y);
Java
Java Quiz
Start Quiz

or Read more about Java Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback