import java.io.*;public class MethodInProcess {
public static void main(String[] args) {
try{
String s = new String("java StringStream");
Process p = Runtime.getRuntime().exec(s);
BufferedReader bufReader = new BufferedReader(
new InputStreamReader(
p.getInputStream()));
String line;
while((line = bufReader.readLine()) != null){
System.out.println(line);
}
}catch(IOException e){
}
}
}public class StringStream { public static void main(String[] args) {
System.out.println("one");
System.out.println("two");
System.out.println("three");
System.out.println("four");
System.out.println("five");
}
}运行第一个类会有第二个类中相应的输入...可是我不知道如何在第一个类中去运用
p.getOutputStream()...其实我的主要目的是能在两个类之间有个交互的过程..即当我的第一个类
接受到了第二个类中匹配的字符后,第一个类会传一些字符给第二个类...该如何实现呢...?
public static void main(String[] args) {
try{
String s = new String("java StringStream");
Process p = Runtime.getRuntime().exec(s);
BufferedReader bufReader = new BufferedReader(
new InputStreamReader(
p.getInputStream()));
String line;
while((line = bufReader.readLine()) != null){
System.out.println(line);
}
}catch(IOException e){
}
}
}public class StringStream { public static void main(String[] args) {
System.out.println("one");
System.out.println("two");
System.out.println("three");
System.out.println("four");
System.out.println("five");
}
}运行第一个类会有第二个类中相应的输入...可是我不知道如何在第一个类中去运用
p.getOutputStream()...其实我的主要目的是能在两个类之间有个交互的过程..即当我的第一个类
接受到了第二个类中匹配的字符后,第一个类会传一些字符给第二个类...该如何实现呢...?
解决方案 »
- 关于JAVA打包和扩大JVM内存的纠结问题
- SQL server2000 怎么让成员的号和户主的号一样,急急急!!!!!!!
- 请问什么是单向链表,双向链表,循环链表....
- 如何将一个对象序列化成XML数据?
- 一个不知原因的错误,请各位高手帮着看看。谢谢,在线等
- java.util.Timer类和javax.swing.Timer类有什么区别?
- 有谁知道在南京的java程序员的薪水是多少???
- JToolBar的问题,大家来帮忙,高分
- 谁有jbuilder 6的序列号,谢谢
- where can i download WebSphere4.0 ?
- 为什么只import java.awt.*; 就可以使用Jframe?不要再import javax.swing.*; ?
- 刚接触JAVA 用什么编译器比较好
YuLimin...以前的总结在哪里可以找到呀?
谢了先..