相关试题
单选题 下面的Java程序创建了一个文件输出流对象,用来向文件test.txt中输出数据,假设程序当前目录下不存在文件test.txt,编译下面的程序Test.java后,将该程序运行3次,则文件test.txt 的内容是( )。 import java.io.*; public class Test { public static void main(String args[]) { try { String s="ABCDE"; byte b[]=s.getBytes(); FileOutputStream file=new FileOutputStream("test.txt",true); file.write(b); file.close(); }catch(IOException e) { System.out.println(e.toString()); } } }
单选题 在Java中,当点击鼠标或者拖动鼠标时,触发的事件是下列的哪一个?( )
单选题 ServletConfig 类用作什么?
单选题 使用 HTTPSession接口来跟踪你的servlets中会话数据。为把值加入到此会话对象,你应使用哪个函数?
单选题 在Servlet程序中,service()方法将完成什么操作?
单选题 下列Java代码的输出结果是 : ( ) class Parent{ void printMe() { System.out.println("parent"); } }; class Child extends Parent { void printMe() { System.out.println("child"); } void printall() { super.printMe(); this.printMe(); printMe(); } } public class Test_this { public static void main(String args[]) { Child myC=new Child(); myC.printall(); } }
单选题 在Java中,如果需要从文件中读取数据,则可以在程序中创建哪一个类的对象( )
单选题 编写和运行Java applet程序与编写和运行Java application程序不同的步骤是:( )