文件new.txt存在吗? <%=f1.exists() %> 2、在“e/test”目录下创建一个子目录Students,在Students目录下创建文件“new.doc” 。 <%@ page contentTyps=”text/html;charset=GB2312” %> <% File dir=new File(“e:/test”,”Students”); <%=dir.mkdir() %>
3
在目录Students下创建文件new.doc
<% File newFile=new File( 3、用字符缓存读文件“e/read.txt”的内容。
<%
File f=new File(“e/read.txt”);
try{
FileReader in= BufferedReader bufferin= ;
String str=null;
while( { out.println(str+”
”); }
bufferin.close(); in.close();
catch(IOException e){ }
%>
4、用字节缓存读文件“e:/read.txt”的内容。
<%
File f=new File(“e:/read.txt”);
try{
FileInputStream BufferedInputStream bufferin=______;
byte c[]=new byte[90]; int n=0;
while(_(n=bufferIn.read(c))!=-1______)
{ String temp=new String(c,0,n); out.println(temp); }
bufferin.close(); in.close();
}catch(IOException e){ }
%>
5、有一个园bean,它的包路径是small.dog,它的字节码文件Circle.class已经存放在正确的目录中。该bean有两个方法getCircleLength()、getCircleArea()分别用于求园的周长、园的面积,使用该bean来求园的周长和面积。
________
园的周长是:
__________
园的面积是:
______
6、下面程序通过数据源(名称为:grade)连接数据库。
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
_______
<%
Connection conn; Statement stmt; ResultSet rs;
try{
Class.forName(__”sun.jdb