Java基础新大纲作业:类方法描述、集合IO总结及流特点.pdfVIP

  • 0
  • 0
  • 约8.02千字
  • 约 6页
  • 2026-02-12 发布于北京
  • 举报

Java基础新大纲作业:类方法描述、集合IO总结及流特点.pdf

A:简答题

1、请把我们讲解过的所有类中的方法在API中找到,并使用自己的话进行描述

2、自己整理一份总结集合、IO部分知识点文档

3、请简述打印流(PrintStream、PrintWriter)的特点?

B:看程序写结果(写出自己的分析理由),程序填空,改错,看程序写结果。

1、给出以下代码,,

请问该程序的运行结果?问题,请说明

classTest{

publicstaticvoidmain(String[]args)throwsIOException{

write();

write();

read();

}

publicstaticvoidwrite()throwsFileNotFoundException{

PrintWriterpw=newPrintWriter(newFileOutputStream(d:\\file.txt,true));

pw.println(你好);

pw.close();

}

publicstaticvoidread()throwsIOException{

BufferedReaderbr=newBufferedReader(newFileReader(d:\\file.txt));

Stringline=null;

while((line=br.readLine())!=null){

System.out.println(line);

}

br.close();

}

}

2、给出以下代码,该程序的运行结果?问题,请说明

classimplements

Serializable{privateStringname;

privatetransientintage;public

(){}public(String

name,intage){this.name=name;

this.age=age;}publicvoid

setName(Stringname){this.name

=name;}publicStringgetName(){

returnname;}publicvoidsetAge

(intage){

A:简答题

1、请把我们讲解过的所有类中的方法在API中找到,并使用自己的话进行描述

2、自己整理一份总结集合、IO部分知识点文档

3、请简述打印流(PrintStream、PrintWriter)的特点?

B:看程序写结果(写出自己的分析理由),程序填空,改错,看程序写结果。

1、给出以下代码,请问该程序的运行结果?问题,请说明

classTest{

publicstaticvoidmain(String[]args)throwsIOException{

文档评论(0)

1亿VIP精品文档

相关文档