Ola amigos, será que vcs poderiam me ajudar a resolver a seguinte questão?
Obrigada!!
Dado o código abaixo, indique nas alternativas onde deve ser feito cast ou uma conversão.
private double d = 5.0;
private float f = 3.0F;
private int i = 9;
public String testaCastString(int vi){
String s = Integer.toString(vi);
return s;
}
public double testaCastDouble(float vf){
return vf;
}
public int testaCastInt(int vi){
return (int) (vi*Math.PI);
}
a) f = d + i;
b) d = f + i;
c) i = d + f;
d) f = testaCastDouble(f);
e) i = testaCastInt(d);
f) String s = testaCastString(d);
g) d = testaCastString(i);