Try, this instead:
double t = 49700/40000.0;
System.out.println(t);
If both operands are integers the result will be an integer which will be truncated, and then it will be cast in to a double. If, instead, one of the operands is a double, the result will be a double.