package pack1;
import java.io.*;
public class iostring {
/**
* @param args
*/
private int x;
iostring()
{
this.x = 10;
}
private void SetX() throws IOException
{
BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
String str = buf.readLine();
this.x = Integer.parseInt(str);
}
private void show()
{
StringBuffer temp = new StringBuffer(String.valueOf(this.x));
temp = temp.reverse();
System.out.print(temp.toString());
System.out.print("asdfd");
}
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
iostring iostring1 =new iostring();
iostring1.SetX();
iostring1.show();
}
}
本文介绍了一个使用Java进行基本输入输出操作的例子。该例子通过控制台读取整数并将其反转输出,展示了如何利用BufferedReader从标准输入读取数据及StringBuffer类的使用。

被折叠的 条评论
为什么被折叠?



