当前位置: 技术问答>java相关
这两个dataInputStream的构造函数哪个是正确的????急!!
来源: 互联网 发布时间:2017-04-03
本文导语: new dataInputStream(new InputStream(“in.txt”)); new dataInputStream(new FileInputStream(“in.txt”)); | import java.io.*; class qqqq { public static void main(String[] args) { System.out.println("Hello World!"); try { n...
new dataInputStream(new InputStream(“in.txt”));
new dataInputStream(new FileInputStream(“in.txt”));
new dataInputStream(new FileInputStream(“in.txt”));
|
import java.io.*;
class qqqq
{
public static void main(String[] args)
{
System.out.println("Hello World!");
try
{
new DataInputStream(new FileInputStream("in.txt"));
new DataInputStream(new InputStream("in.txt"));
}
catch(IOException e)
{}
}
}
你自己编译一下吧---
class qqqq
{
public static void main(String[] args)
{
System.out.println("Hello World!");
try
{
new DataInputStream(new FileInputStream("in.txt"));
new DataInputStream(new InputStream("in.txt"));
}
catch(IOException e)
{}
}
}
你自己编译一下吧---
|
给你这个例子,是让你注释一下,看看前后的编译结果。就知道为什么了!