习题集: 一、填空题 1.程序符号 2.授权事件模型
3.actionPerformed(ActionEvent e),itemStateChanged(ItemEvent e) 4.事件适配器
5.new WindowAdapter(),System.exit(0); 二、选择题
1.D 2.C 3.D 4.B 5.A 第9章 参考答案: 实验指导:
9.4.1. 第一处需要填写的代码:g_2d.setStroke(bs); g_2d.setColor(Color.yellow); g_2d.draw(hourLine);
第二处需要填写的代码:secondLine.setLine(120,120,(int)pointSX[a],(int)pointSY[a]); 9.4.2. 第一处需要填写的代码:signal.setRed(0);signal.setYellow(1); 第二处需要填写的代码:g.setColor(Color.green); 习题集: 填空题:
1.Drawstring 2.add(p1) 3.toString(i) 4.public void paint(Graphics g){
5.int count=1;count 1.A 2.B 3.B 4.B 第10章 实验指导: 10.6.1. 第一处需要填写的代码:tempStr=bufReader.readLine(); 第二处需要填写的代码:s*=i; 10.6.2. 第一处需要填写的代码:filePrex == null 第二处需要填写的代码:int j = 0; j < children.length; j++ 10.6.3. 第一处需要填写的代码:inStream,outStream 第二处需要填写的代码:copyBut,0,copyLen 10.6.4. 第一处需要填写的代码:tempStr=inObj.readLine(); 习题集: 一、填空题: 1.Hello!I like Java! 2.110 110 110 110 110 3.InputStreamReader 4.HelloWorld! 5.year%4==0&&year0!=0||year@0==0 6.String s=\二、选择题: 1.D 2.A 3.A 4.B 5.D 6.B 7.B 8.D BufferedReader readLine() 第11章 参考答案: 实验指导: 11.6.1.第一处需要填写的代码:Class.forName(DBDRIVER) ; conn = DriverManager.getConnection(DBURL,DBUSER,DBPASSWORD) ; 第二处需要填写的代码:conn = getConnection();stmt = conn.createStatement(); 第三处需要填写的代码:stmt.executeUpdate(\ stmt.executeUpdate(\stmt.executeUpdate(\ into into t_test t_test values('dg','df','fdg');\ values('dfg','dfg','dfg');\ stmt.executeUpdate(\第四处需要填写的代码:stmt.executeUpdate(\ 11.6.2.第一处需要填写的代码:pstmt=conn.prepareStatement(\into t_grade values(?,?,?);\;pstmt.execute(); 第二处需要填写的代码:rs = stmt.executeQuery(\ while(rs.next()){System.out.print(\姓名:\ System.out.print(\课程:\System.out.println(\成绩:\ conn.close(); stmt.close(); rs.close(); } } 第三处需要填写的代码:try{ catch(SQLException e){ e.printStackTrace(); 11.6.3.第一处需要填写的代码:conn = getConnection(); stmt = conn.createStatement(); stmt.executeUpdate(\ 第二处需要填写的代码:pstmt = conn.prepareStatement(\t_grade set course = ?,grade=? where name = '\ pstmt.execute(); 习题集: 一、填空题: 1.建立与数据库的连接、处理结果集 2.executeUpdate 3.CallableStatement 4.conn.createStatement();、rs.next(); 5.conn.createStatement(ResultSet.Type_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE):、rs.updateRow(); 二、选择题: 1.B 2.A 3.B 4.B 5.C 6.A 7.A 8.C