标题:[求助]这个程序错在那里?
取消只看楼主
lbm717ls
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2005-11-2
 问题点数:0 回复次数:0 
[求助]这个程序错在那里?
//判断输入的字符是否是字母
import java.io.*;
public class HelloWorldClass
{
public static void main(String[] args)
{
new HelloWorldClass().output();
}
public HelloWorldClass(){ }
public void output()
{
Input myinput=new Input();
char c=myinput.getThechar();
if(c>=65&c<=90||c>=97&c<=122)
System.out.println("It is a letter. The letter is :"+c);
else
System.out.println("It is not a letter :");
}
class Input
{ public char getTheChar()
{
char c=0;
System.out.println("Enter a character :");
try{
c=(char) System.out.read();
}catch(IOException(e){};
搜索更多相关主题的帖子: public import letter 字母 
2006-09-09 16:44



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-89045-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.748682 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved