File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes compton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "compton" Watch "compton" New topic
Author

compton

kofi ofei
Ranch Hand

Joined: May 22, 2005
Posts: 39
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

Joined: Feb 05, 2001
Posts: 17250
    
    6

Moving to Java In General (Beginner) forum.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
As with your other post, quoting the error message will help us figger it out.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
GeeCON Prague 2014
 
subject: compton