import java.io.*;
import java.util.*;
public class example_io {
public static void main(String[] args){ DataInputStream in=new DataInputStream(System.in);
DataOutputStream out=new DataOutputStream(System.out); System.out.println("please input the data");
int x=0; try{
x=in.readInt();
}catch(IOException e){}
try{
out.writeInt(x);
}catch(IOException e){}}
}
import java.util.*;
public class example_io {
public static void main(String[] args){ DataInputStream in=new DataInputStream(System.in);
DataOutputStream out=new DataOutputStream(System.out); System.out.println("please input the data");
int x=0; try{
x=in.readInt();
}catch(IOException e){}
try{
out.writeInt(x);
}catch(IOException e){}}
}
解决方案 »
- java中 JOptionPane.showMessageDialog()总是出现错误,请高手指教,谢谢
- 谁能讲讲“JAVA线程机制”怎么回事?
- 菜鸟学JAVA:用JDBCODB连接ACCESS时需要装JDBCODBC驱动吗?怎么装,去哪下载??
- 如何计算程序执行时间?
- java语法问题
- Java初学者CSDN第4问!
- 菜鸟请求帮助~万分感谢!!
- 怎样去掉连接下面的线呢?
- 求救!高分!关于JAVA类调用的问题100分,在线等待
- a tool class to convert bmp to wbmp used in wap
- 初学者求教:为什么界面上的组件第一次显示不出来
- 刚才写的,编译通过,执行时只显示frame的白诓,看不见文本区和标签(在线等)
怎么输入:8
然后要按2次enter键才有输出的 ??还有输入88就可以正常输出88 ??
输入888时候,无论按多少次enter键都没输出 ???
更奇怪的是输入字符居然没发生意外,竟然正常的输出了???
因为都是以字节流方式输入输出的。
当输入88时候,应该是2个字节
当888的时候字节大小是256限制,所以无法readint()