编译好后,点击文件名,右键,上有run
解决方案 »
- Java新手请教:如果产生一个由100个随机数字或英文字符组成字符串?
- Can you tell the differences between the two sentences?
- 读取文件夹中的文件运行3次,居然出现不同的结果
- (下载)MyEclipse下开发Struts和Hibernate的录像。。
- 数学不好就是吃亏..百分求算法..
- 变量名如何动态取值?
- 弱弱的请教:Borland Socket Server有什么用?
- 帮我修改一下下小程序吧
- 看不懂程序
- 请教构造方法中,由于private所以使用的set和get方法?
- MD5码用什么工具可以验证?
- 我是初学者,我的java编辑工具的问题?谢谢 急
public static void main(String[] args){
int i;
Ststem.out.println("enter a integer: ');
i=ConsoleIn.readlnInt();
System.out.println(i);
}
}import java.util.*;
import java.io.*;public final class ConsoleIn {
private static BufferedReader brStream =
new BufferedReader(new InputStreamReader(System.in));
private static StringTokenizer getTokenizer() throws IOException {
return new StringTokenizer(brStream.readLine());
}
/* Reads a line of text and returns the line as integer*/
public static int readlnInt() {
String stringToken = null;
boolean ok = true;
int result = 0;
while (ok) {
try {
stringToken = getTokenizer().nextToken();
result = Integer.parseInt(stringToken);
ok = false;
}
catch (IOException e) {
System.out.println("Invalid Input!");
System.out.print("Please enter the data again: ");
}
}
return result;
}
}在jbuilder第一个程序有问题!找不到consolein.但是netbeans里没有问题, 为什么呢?有没有人知道如何解决?