Hi, friends
I don't know how to resolve this task. I've been seeing that someone has resolved this by changing the casting on line 14 from 'short' to 'int' and it runs, but i can't understand the reason.
Could anyone explain it to me?
Thanks a lot.
package com.codegym.task.task10.task1001;
/*
Task No. 1 about integer type conversions
*/
public class Solution {
public static void main(String[] args) {
int a = 0;
int b = (byte) a + 46;
byte c = (byte) (a * b);
double f = (char) 1234.15;
long d = (short) (a + f )/( c + b);
System.out.println(d);
}
}