class Switch
{
	public static void main(String args[ ])
	{
		String season;
		int month =10;
		switch(month)
		{
			case 12:
			case 1:
			case 2:
				season = "Winter";
				break;
			case 3:
			case 4:
			case 5:
				season = "Spring";
				break;
			case 6:
			case 7:
			case 8:
				season = "Summer";
				break;
			case 9:
			case 10:
			case 11:
				season = "Autumn";
				break;
			default:
				season = "Bogus Month";
		}
		System.out.println(month+" Month is in the " + season +".");
	}
}
Re: how can i put user through input in java program 80 80

You need to use Scanner to scan for input from the console. Should be a quick google search.

Re: how can i put user through input in java program 80 80

Go through the IO section of java, can try the following link -
http://download.oracle.com/javase/tutorial/essential/io/cl.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.