try
{
char c;
DataInputStream Is = new DataInputStream(new StringBufferInputStream(s2));
System.out.println("Formatted read data");
while((c=(char)Is.readByte())!=-1)
System.out.print(c);
Is.close();
}
catch(EOFException e)
{
System.out.println("end of String");
}提示方法过时了
new StringBufferInputStream(s2);
要如何作才能得到正确的解答.
这里要用到字符串流,并且可以以读入特殊类型数据的方法
读入数据.
{
char c;
DataInputStream Is = new DataInputStream(new StringBufferInputStream(s2));
System.out.println("Formatted read data");
while((c=(char)Is.readByte())!=-1)
System.out.print(c);
Is.close();
}
catch(EOFException e)
{
System.out.println("end of String");
}提示方法过时了
new StringBufferInputStream(s2);
要如何作才能得到正确的解答.
这里要用到字符串流,并且可以以读入特殊类型数据的方法
读入数据.
方法过时是指DataInputStream。
特别是要用到readln的,更要用BufferedReader
在新版的java类库中较少用到data这类涵盖范围很广的词了
楼主不妨改下一试