Circulo - } public void setRadio(int r){ radio = r; }...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Circulo{ p //Declaro mis variables de instancia public int radio; public String color; public String unidadMedida; p //Defino mis métodos de acceso (get) public int getRadio(){ return radio; } public String getUnidadMedida(){ return unidadMedida; } public String getColor(){ return color; } public void setUnidadMedida(String U){ unidadMedida = U;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } public void setRadio(int r){ radio = r; } public void setColor(String c){ color = c; } //Mtodo que obtiene el permetro public double calculaPerimetro(){ double variableTemporal = 0; variableTemporal = 2 * Math.PI * radio; return variableTemporal; } public double calculaArea(){ return Math.PI * Math.pow(radio,2); } }...
View Full Document

This note was uploaded on 10/29/2009 for the course ITC TC-1002 taught by Professor X during the Spring '09 term at ITESM.

Ask a homework question - tutors are online