Hey,
I have a code snippet and in that I want to get a float result. can help me out with the updated code.
class CalcV {
float v;
float calcV(int s, int t) {
v = s / t;//here I am getting the error
return v;
} //end calcV
}
public class PassObject {
public static void main (String[] args ) {
int distance;
distance = 4;
int t;
t = 3;
float outV;
CalcV v = new CalcV();
outV = v.calcV(distance, t);
System.out.println("velocity : " + outV);
} //end main
}//end class
Thanks