题目内容

一跨大步接球牢,二跨小步,三要()

A. 高跳
B. 前跳

查看答案
更多问题

9、设置光标大小需在【选项】对话框中的( )选项卡中设置。

A.草图
B.打开和保存
C.系统
D.显示

请阅读下面的程序,并完成填空(共5个空)。import java.util.*;public class TestMap {public static void main(String[] args) {//声明Map对象,创建HashMap对象Map map =(1);Student s1 = new Student(20001, "张卫东", 20);Student s2 = new Student(20006, "李晓琦", 21);Student s3 = new Student(20003, "欧菁璐", 19);Student s4 = new Student(20008, "郑南翔", 26);Student s5 = new Student(20001, "彭文亮", 22);map.put(s1.getId(), s1);map.put(s2.getId(), s2);map.put(s3.getId(), s3);map.put(s4.getId(), s4);map.put(s5.getId(), s5);// 使用迭代器遍历所有的value对象Iterator itervalue =map.(2) .iterator();while(itervalue.hasNext()){System.out.println(itervalue.next());}System.out.println(map.get(20001)); //此语句的输出结果是 (3) __// 下面的语句用于删除学号为20006的学生信息(4);Iterator> iterentrydel = map.entrySet().iterator();while(iterentrydel.hasNext()){Map.Entry entry = (Map.Entry)iterentrydel.next();// 按key <=> value形式输出键值映射对System.out.println((5)+ "<=>" +entry.getValue());}}}class Student{private int id;private String name;private int age;public Student(int id,String name,int age){this.id=id;this.name=name;this.age=age;}// 此处为各属性的setter和getter方法(略)...public String toString(){return name + ":" + id + ":" + age;// 注:字符串中所包含的标点符号为英文标点符号}}

本程序实现图片文件复制,请在阅读程序基础上完成填空(共5个空)。import java.io.*;public class TestBinFileCopy{public static void main(String[] args) throws IOException {String source_path = "d:\\myfig.jpg";String destination_path = "d:\\myfig_copy.jpg";// 创建BinFileCopy类的实例化对象,并调用copy方法完成图片文件复制(1).copy(source_path, destination_path);}}classBinFileCopy{// 用字节流完成二进制文件的复制public voidcopy(String source_path, String destination_path) throws IOException {// 下面的语句用于声明并创建长度为16的字节数组byte[] bin =(2) ;FileInputStream fis = new FileInputStream(source_path);FileOutputStream fos =(3) ;while (fis.read(bin) !=(4) ) {(5) ;}// 此处为关闭流对象的代码(略)}}

本程序利用缓冲流实现用户信息文件(users.txt)的读写操作,请在阅读程序的基础上完成填空(共5个空)。import java.io.*;import java.util.*;class User {private String id;private String type;private String password;private String name;private byte sex;private String city;public User(String id, String type, String password, String name, byte sex, String city) {super();this.id = id;this.type = type;this.password = password;this.name = name;this.sex = sex;this.city = city;}public User(String[] userInfo){this.id = userInfo[0];this.type = userInfo[1];this.password = userInfo[2];this.name = userInfo[3];this.sex = Byte.parseByte(userInfo[4]);this.city = userInfo[5];}// 此处为各属性的setter和getter方法(略)...@Overridepublic String toString() {return id + ":" + type + ":" + password + ":"+ name + ":" + sex + ":" + city; // 此处的冒号均为英文符号}}public class TestIOForUserFile {public static void main(String[] args) {List list = new ArrayList();list.add(new User("u00001", "普通用户", "pw00001", "崔翰林", (byte)1, "太原"));list.add(new User("u00002", "普通用户", "pw00002", "李红梅", (byte)0, "北京"));list.add(new User("u00003", "普通用户", "pw00003", "张松民", (byte)1, "上海"));list.add(new User("u00010", "管理员", "pw00010", "孟令君", (byte)1, "深圳"));Iterator iter = list.iterator();String fileName = "users.txt";FileWriter fw = null;BufferedWriter bw = null;try {fw = (1)(fileName, true);bw = new BufferedWriter(fw);while (iter.hasNext()) {User user = iter.next();//下面的语句将user的信息(可以通过user.toString()方法获取得到)写入缓冲输出流bw(2);bw.newLine();}} catch (IOException e) {e.printStackTrace();} finally {// 此处为关闭流对象代码(略)}List list2 = new ArrayList();FileReader fr = null;BufferedReader br = null;String[] userInfo;User user2;String s;try {fr = new FileReader(fileName);br =(3);while((s =(4)) != null){userInfo = s.split(":");// 调用User的单参数构造方法创建User对象user2 =(5);list2.add(user2);}for (User user: list2) {System.out.println(user);}} catch (IOException e) {e.printStackTrace();} finally {// 此处为关闭流对象代码(略)}}}

答案查题题库