コード例 #1
0
 public void actionPerformed(ActionEvent ev) {
   CalculatorAlt cal = new CalculatorAlt();
   setNum_working(String.valueOf(cal.getNum_memory()));
   cal =
       null; // setting object to null makes it more likely to be deleted by the Garbage
             // Collector
   // System.out.println("MR");
 }
コード例 #2
0
 public void actionPerformed(ActionEvent ev) {
   CalculatorAlt cal = new CalculatorAlt();
   double temp_working = Double.parseDouble(cal.getNum_working());
   double temp_memory = cal.getNum_memory();
   double three = temp_working + temp_memory;
   setNum_memory(three);
   setNum_working(String.valueOf(three));
   cal =
       null; // setting object to null makes it more likely to be deleted by the Garbage
             // Collector
   // System.out.println("MA");
 }