⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filedemo7.java

📁 JAVA程序设计课程中各章节的程序实例。
💻 JAVA
字号:
/**
*Another simple file demonstration program
*Reading chracters from screen
xhcprince
*/

import java.io.*;
/*----------------------------------------------------------------------------------
	If you import java.io.*,you have to throws the IOExcception!
----------------------------------------------------------------------------------*/
public class fileDemo7
{
	public static void main(String args[]) throws IOException
	{
		int n;
		char c;

		for(int i=0; i<5; ++i)
		{
			System.out.println("Enter a chracter:");
			n = System.in.read();
			c = (char)n;
			System.in.skip(2);	//skip the enter key(the unicode is 2 bytes)

			if(Character.isLowerCase(c))
			{
				System.out.println("You've entered a lower case character " + c);
			}

			else if(Character.isUpperCase(c))
			{
				System.out.println("You've entered a upper case character " + c);
			}

			else
			{
				System.out.println("You are not entering characters!");
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -