I am having a little difficulty with a school assignment, long story short I declared two local variables in a method and I need to access those variables outside the method :
public String convertHeightToFeetInches(String input){
int height = Integer.parseInt(input);
int resultFeet = height / IN_PER_FOOT;
int resultInches = height % IN_PER_FOOT;
Math.floor(resultInches);
return input;
}
I would have to print the following string in a different method :
System.out.println("Height: " + resultFeet + " feet " + resultInches + " inches");
Any suggestions?
Thank you.
FeetInchesand returnFeetInchesfrom the method.classinstance which contains thefeetandinchesproperties