CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Type Casting Behavior

Java code walkthrough · Question 25
mediumOperators

Code

Read carefully. What does this print?
1public class Main {
2 public static void main(String[] args) {
3 double x = 9.7;
4 int y = (int) x;
5 System.out.println(y);
6 System.out.println((double) 5 / 2);
7 }
8}

Your answer