← Back to Question List
Java Code Walkthrough #30
Integer Division Then Cast
📄 Code
Read carefully — what does this print?1public class Main {2 public static void main(String[] args) {3 int a = 5;4 int b = 2;56 double x = a / b;7 double y = (double) a / b;89 System.out.println(x);10 System.out.println(y);11 }12}