java中获取用户输入字符,并将字符大写后显示

/*

   java 获取输入,大写在显示

    @author:luowen

    @time:2013-10-23

*/

import java.io.*;



class GetParam

{

	public static void main(String[] args)

	{

		InputStreamReader isr = null;

		BufferedReader br = null;

		try

		{

			InputStream in = System.in;



			 isr = new InputStreamReader(in);



			 br = new BufferedReader(isr);



			String line = null;



			while((line = br.readLine()) != null)

			{

				if(line.equals("over"))

								break;

				System.out.println(line.toUpperCase());

			}



		}

		catch(IOException e)

		{

			System.out.println(e.toString());

		}

		finally

		{

			try

			{

				br.close();

			}

			catch(IOException e)

			{

				System.out.println(e.toString());

			}



		}



	}

}

  

你可能感兴趣的:(java)