Day - } else if(day == 2 || day == 22){ return (month +...

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

View Full Document Right Arrow Icon
package lab09; p public class Day { p private String month; private int day; p public Day(String month, int number){ this.month = month; this.day = number; } public String toString(){ if(day == 1 || day == 21 || day == 31){ return (month + " " + day + "st");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } else if(day == 2 || day == 22){ return (month + " " + day + "nd"); } else if(day == 3 || day == 23){ return (month + " " + day + "rd"); } else return (month + " " + day + "th"); } }...
View Full Document

This note was uploaded on 09/20/2011 for the course COM SCI 227 taught by Professor Staff during the Spring '11 term at Iowa State.

Ask a homework question - tutors are online