下列输入输出语句使用正确的是( )
A: InputStream in=new InputStream(“hello.txt”);
B: InputStream in =new BufferedInputStream (“hello.txt”);
C: InputStream in =new FileOutputStream(“hello.txt”);
D: InputStream in =new Reader(“hello.txt”);
A: InputStream in=new InputStream(“hello.txt”);
B: InputStream in =new BufferedInputStream (“hello.txt”);
C: InputStream in =new FileOutputStream(“hello.txt”);
D: InputStream in =new Reader(“hello.txt”);
举一反三
- 文件 book.txt 在当前程序所在目录内,其内容是一段文本:"hello”,下面代码的输出结果是:txt = open("book.txt", "r")print(txt)txt.close() A: hello B: 以上答案都不对 C: txt D: book.txt
- 下列方法中,能正确创建 JavaScript 对象的是( )。 A: var txt = new Object[name:"George",price:25] B: var txt = new Object(name:"George",price:25) C: var txt = new Object{name:"George",price:25} D: var txt = new Object({name:"George",price:25})
- 要使用InputStream和OutputStream这两个类方法,可以使用new关键字通过构造方法实例化对象。( )
- Java的输出流主要由( )作为基类。 A: OutputStream和Reader B: OutputStream和Writer C: InputStream和Writer D: InputStream和Reader
- 下列方法中,能正确创建 JavaScript 对象的是( )。 A: var txt = new Object[name:"George",price:25] B: var txt = new Object(name:"George",price:25) C: var txt = new Object{name:"George",price:25} D: var txt = new Object({name:"George",price:25})