Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compton

 
kofi ofei
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the programme below as 1 error in it. i was wondering if you could help me solve this. thanks



/** Array initialization */
public class compton
{
public static void main(String[] args)
{
int [] days =
{31,28,31,30,31,30,31,31,30,31,30,31};
System.out.print("Month number...");
int month = (int) wellHouseInput.readNumber();
if(month < 1 || month > 12)
{
System.out.println("Not a valid month number");
} else {
System.out.print("That month has ");
System.out.print(days[month-1]);
System.out.println("days");
}
}
}
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Java In General (Beginner) forum.

Mark
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As with your other post, quoting the error message will help us figger it out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic