多项选择题
在J2EE中,下面代码中,()不会编译错误。
A.File f = new File("/","autoexec.bat");
B.DataInputStream din = new DataInputStream(new FileInputStream("autoexec.bat"));
C.InputStreamReader in = new InputStreamReader(System.in);
D.OutputStreamWriter out = new OutputStreamWriter(System.in);
点击查看答案
相关考题
-
单项选择题
在J2EE中,如果去编译并运行下面的代码,在这里假定在当前目录下没有Hello.txt文件: import java.io.*; public class Mine { public static void main(String argv[]){ Mine m=new Mine(); System.out.println(m.amethod()); } public int amethod() { try { FileInputStream dis=new FileInputStream("Hello.txt"); } catch (FileNotFoundException fne) { System.out.println("No such file found"); return -1; } catch(IOException ioe) { } finally { System.out.println("Doing finally"); } return 0; } } 结果会输出()。
A.No such file found
B.No such file found -1
C.No such file found doing finally -1
D.0 -
单项选择题
在J2EE中,某一java程序中有如下代码: DataInputStream din = new DataInputStream(new BufferedInputStream (new FileInputStream("employee.dat"))); System.out.print(din.readByte()); 假设在employee.dat文件中只有如下一段字符:abcdefg。则:System.out在屏幕上打印( )。
A.a
B.b
C.97
D.98 -
多项选择题
在J2EE中,Servlet1中有如下代码: PrintWriter out = response.getWriter(); out.println("请同学们仔细看题目再回答!"); 假设该Servlet运行的平台是Apache Tomcat4.03以下版本。 为了可以在浏览器中显示汉字,可以( )。
A.在这两行代码前加上代码:response.setContentType("text/html,charset=GBK");
B.已经可以显示汉字,不用添加任何代码
C.在这两行代码前加上代码:response.setContentType("text/html");
D.在这两行代码前加上代码:response.setContentType("text/html,charset=gb2312");
