My constructor should be a no args constructor..what is that? My constructor should also accept an integer and it should set it to its corresponding month(1-12).
It should also accept the name of the month and make its corresponding match(Jan-Dec).
How do I begin? My main question is how do I input my months so they match with the integers??
public class GetMonthName
{
public static void main(String[] args)
{
String[] monthName = {"January", "February",
"March", "April", "May", "June", "July",
"August", "September", "October", "November",
"December"};
Calendar cal = Calendar.getInstance();
String month = monthName[cal.get(Calendar.MONTH)];
System.out.println("Month name: " + month);
}
}
Where do I add the integers?? Or is this even right?
Thanks you guys! You guys are amazing programmers and I really appreciate your help!!

New Topic/Question
Reply




MultiQuote





|