public class CalculatorGui {
public static void main() {
String lhsNumber = "0";
String rhsNumber = "0";
String operator = "";
btn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
if (operator == "") {
lhsNumber = lhsNumber == "0" ? btn.getText() : lhsNumber + btn.getText();
}
}
});
#how to access and modify a local variable in enclosing/inner scope?
6 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @dapper valve! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.