Converting int to string



Can anyone tell me how to develop this so that it shows the months ie
January, February etc when it runs.

class DayCounter {
public static void main(String[] arguments) {
int yearIn = 2004;
int monthIn = 1;
if (arguments.length > 0)
monthIn = Integer.parseInt(arguments[0]);
if (arguments.length > 1)
yearIn = Integer.parseInt(arguments[1]);
System.out.println(monthIn + "/" + yearIn + "has " + countDays(monthIn,
yearIn) + " days.");
}

static int countDays(int month, int year) {
int count = -1;
switch (month) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
count = 31;
break;
case 4:
case 6:
case 9:
case 11:
count = 30;
break;
case 2:
if (year % 4 == 0)
count = 29;
else
count = 28;
if ((year % 100 == 0) & (year % 400 != 0))
count = 28;
}
return count;
}
}

.



Relevant Pages

  • Re: Set default printer for the machine
    ... > public static void Main{ ... > static int SetAsDefaultPrinter ... > int ret = 0; ... > using (ManagementObject printer = new ManagementObject(path)) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: a few beginners questions ....
    ... public static void main(Stringargs) { ... static int i=3; regerded as a part of initializer? ...
    (comp.lang.java.programmer)
  • Re: Set default printer for the machine
    ... public static void Main{ ... static int SetAsDefaultPrinter ... using (ManagementObject printer = new ManagementObject(path)) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Usage of Static variable name in static context
    ... public static void main{ ... static int getI{ ... class TestStaticThis ... public static void main ...
    (comp.lang.java.programmer)
  • Re: I am always afraid of this code
    ... static int x,y; ... public static void main ... result is the value of x before the increment. ... However, as the JLS says, ...
    (comp.lang.java.programmer)