菜鸟入门 请教:入键盘接收字符串 BufferedReader br=new BufferedReader(new InputStreamReader(System.in));String cmd=br.readLine(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 假设你的.class放在从C:\,叫Arg.class运行Console,键入java Arg abcd就可以了,这样就会输出abcd,abcd就是命令行第一个参数,传给args[0] 那可不可以不用参数?就是在 DOS 打印出一行提示语,然后再从键盘接收字符串付给 args[0]谢谢! package com.ok.util;import java.util.*;import java.io.*;/** * <p>Title: OK</p> * <p>Description: For the OK HR bank ^_^</p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: ok.com.cn</p> * @author apollo * @version 1.0 */public class Untitled1 { public Untitled1() { } public static void main(String[] args) { Untitled1 untitled11 = new Untitled1(); Thread tr=new Thread(); for(;;){ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { String cmd = br.readLine(); System.err.println("The command of you input is:"+cmd); tr.sleep(1000); }catch(Exception ie){ ie.printStackTrace(); } } }} import java.io.*;class ReadLines {public static void main(String args[]) throws IOException{BufferedReader br = new BufferedReader(new InputStreamReader(System.in));String str;System.out.println("Hellow Everyone!!!!");System.out.println("Enter 'exit' to quit");do {str = br.readLine();System.out.println(str);} while(!str.equals("exit"));}} 使用反射编扩展数组,运行结果总是出错 字符串 转 日期的 基础问题 如何获得JVM执行过程中调用的方法名(包含Java自带的)? 没有办法了,只有向兄弟们求救啦! java批量处理sql,用的是oracle cannot resolve symbol什么意思? 谁说英语不好就可学好计算机?????????? JBuilder6的简单编辑问题 使用Vector的一个问题 难道没人知道如何使用java访问lotus邮件的高手吗? 一个很棘手的问题。关于jzlib包的. 如何判断JCheckBox的状态?急,,,急
运行Console,键入java Arg abcd
就可以了,这样就会输出abcd,abcd就是命令行第一个参数,传给args[0]
就是在 DOS 打印出一行提示语,然后再从键盘接收字符串付给 args[0]
谢谢!
import java.io.*;
/**
* <p>Title: OK</p>
* <p>Description: For the OK HR bank ^_^</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: ok.com.cn</p>
* @author apollo
* @version 1.0
*/public class Untitled1 {
public Untitled1() {
}
public static void main(String[] args) {
Untitled1 untitled11 = new Untitled1();
Thread tr=new Thread();
for(;;){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
String cmd = br.readLine();
System.err.println("The command of you input is:"+cmd); tr.sleep(1000);
}catch(Exception ie){
ie.printStackTrace();
}
}
}}
class ReadLines {
public static void main(String args[]) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
System.out.println("Hellow Everyone!!!!");
System.out.println("Enter 'exit' to quit");
do {
str = br.readLine();
System.out.println(str);
} while(!str.equals("exit"));
}
}