谁有ConsoleReader的class文件?急!急!

leebocngz 2002-05-11 02:26:08
请问那位大虾有ConsoleReader,本人急欲用它,但jdk1.3里面没有,
我的信箱是:umlib@cc.umanitoba.ca

谢谢!
...全文
40 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
leebocngz 2002-05-12
  • 打赏
  • 举报
回复
问题已经解决了,但我还是要给绿色咖啡分,谢谢
alphazhao 2002-05-11
  • 打赏
  • 举报
回复
大哥
这是core java(java核心技术)那本书的作者自个写的
要买了那本书(或者到处找……)上的光盘才能copy到啊
并不是java自个带的
leonzhao 2002-05-11
  • 打赏
  • 举报
回复
如果是读入Console的,请看这个:(Core Java的例子)

public class Console
{
public static void printPrompt(String prompt)
{ System.out.print(prompt + " ");
System.out.flush();
}
/**
read a string from the console. The string is
terminated by a newline
@return the input string (without the newline)
*/
public static String readLine()
{ int ch;
String r = "";
boolean done = false;
while (!done)
{ try
{ ch = System.in.read();
if (ch < 0 || (char)ch == '\n')
done = true;
else if ((char)ch != '\r')
r = r + (char) ch;
}
catch(java.io.IOException e)
{ done = true;
}
}
return r;
}
/**
read a string from the console. The string is
terminated by a newline
@param prompt the prompt string to display
@return the input string (without the newline)
*/

public static String readLine(String prompt)
{ printPrompt(prompt);
return readLine();
}
}
leonzhao 2002-05-11
  • 打赏
  • 举报
回复
那是个什么类?干什么用的?

62,635

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧