// Implementación de un acumulador sencillo
// GRABAR EN UN ARCHIVO	"Acumulador.java" 	(OJO CON LAS MAYUSCULAS!)
// COMPILAR CON:		"javac Acumulador.java"	(NO OLVIDAR EL .java!)
// ESTA CLASE NO ES UNA APLICACION, pero nos va a servir enseguida
import java.io.*;
public class  Acumulador {	


  // Atributos
  int acm;					

  // Constructor				
  public Acumulador() {			
    acm = 0;
  }

  // Métodos

  public int Acumular(int mivar) {
     //    System.out.print("Mi atributo de la clase tiene: ");			
    //     System.out.println(acm);
    //     System.out.print("Mi variable que recibe la clase tiene: ");			
    //     System.out.println(mivar);
    acm = acm + mivar;
    //     System.out.println(acm);			

    return acm;				
  }
  public int getAcumulador() {		
    return acm;			
  } 
  
// Investigar esto
//  protected void finalize() throws Throwable { 

   
}

