📄 filedemo7.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 + -