I have this java code and I want to use return to return a String from a method to a class, but I can't figure out how to use the returned String in this class:
private class NumsysAction implements ActionListener {
public void actionPerformed(ActionEvent event) {
String numsys_pushed = event.getActionCommand();
if (active_numsys==2 && numsys_pushed.equals("DEC")) {
chng_numsys_bin_dec(display.getText());
?????
}
}
}
This is the method I want to use to return a String:
public String chng_numsys_bin_dec(String chng_numsys_input) {
String chng_numsys_output = "String I want to return";
return chng_numsys_output;
}
What do I have to write where the questionmarks are to put the returned String called "chng_numsys_output" into a new String variable?
chng_numsys_bin_decinvocation. You don't want to return it ;)String returnValue = chng_numsys_bin_dec(display.getText());before the question marks.