Since int
is less precise than double
I thought I needed to cast it when parsing it into a method. Yet the following code runs fine. Why?
public class MyClass {
public static void main(String[] args) {
System.out.println(met(3/2));
}
static String met(int i){
return "This is what I get " + i;
}
}