0
Type casting in Java comes is quite simply when one data type is changed to another, and it comes in two flavours, implicit and explicit. Implicit is when the conversion is aitomatic, for example: int x = 1; double y = x; In this case, the value given to y is automatically (implicitly) casted into a double. Alternatively, you can explicitly type cast variables: double x = 1.9830; System.out.println(int(double)); Outputs: 1 In this case, you're explicitly typecasting a double into an integer, in which case the remainder is dropped. Best of luck.
21st Dec 2016, 12:19 AM
Nathan Smith
Nathan Smith - avatar