Fecha - case 6 return"Junio" case 7...

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

View Full Document Right Arrow Icon
public class Fecha{ p public int dia; public int mes; p public Fecha(){ dia = 1; mes = 1;} m public Fecha(int d, int m){ dia = d; mes = m;} m public int getDia(){ return dia;} r public int getMes(){ return mes;} r public void setDia(int d){ dia = d;} d public void setMes(int m){ mes = m;} m //Otros métodos / public String dimeMes(){ switch(mes){ case 1: return "Enero"; case 2: return "Febrero"; case 3: return "Marzo"; case 4: return "Abril"; case 5: return "Mayo";
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: case 6: return "Junio"; case 7: return "Julio"; case 8: return "Agosto"; case 9: return "Septiembre"; case 10: return "Octubre"; case 11: return "Noviembre"; case 12: return "Diciembre"; default: return "No existe ese mes";}} d public String toString(){ return dia+"/"+dimeMes();} r public boolean equals(Fecha x){ if(this.dia==x.dia && this.mes==x.mes) return true; else return false;} r }...
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