I'm trying to do a very basic operation as follows:
double a=21/5;
System.out.println(a);
However, each time I get 4.0
as the output and not 4.2
. I'm encountering this for the first time. I've been using Java for years, but never came across this obscurity.