201421123042 Java Programming Week 12th

Source: Internet
Author: User

1. Study summary 1.1 This week summarize multiple streams and file-related content in the way you like (mind map or other).

2. System-oriented integrated design-Library management system or shopping cart

Use streams and files to transform your library management system or shopping cart.

2.1 A brief description of how to use streams and files to transform your system. What is the format of the data in the file?

A: I started with a static initialization block initial library data and then the initialization of the book data using object flow ObjectOutputStream write to the file Book.data to save, the user module is similar, and in two modules each write a method to save the modified file data for the operation of the process According to the changed documents. Writing to a file with an object stream is saved in hexadecimal because the object flow is inherently suitable for transmission between networks.

2.2 Brief description of what interfaces and classes are used in the file reading and writing section of the system with the stream associated with the file? Why use these interfaces with classes?

A: Using the InputStream, OutputStream interface under the ObjectInputStream and ObjectOutputStream sub-class, there are file classes, The serializable interface is used when serializing objects, and the object flow is used in order to store the entire information of an object in a file, and if it is just a normal byte stream, it is not possible to do so, and then when the object is written or read using object flow, the object is serialized when it is used. This is to ensure that the object can be written to the file, and read from the file correctly into the program, it is necessary to use the serializable interface to achieve the serialization of the object.

2.3 Read and write file-related code. Critical lines need to be annotated.

For:
InitializationLibrary

Save the modified Library file:

Initialize the user module:

Save the modified user information to a file:

3. Code volume Statistics 3.1 Statistics the amount of code completed this week

Week Time Total code Amount New Code Volume total number of files number of new files
1 0 0 0 0
2 0 0 0 0
3 125 125 2 2
4 141 141 3 3
5 674 647 13 13
6 647 647 13 13
7 695 48 14 1
8 1867 1867 25 25
9 1974 107 29 4
10 2227 253 34 5
11 2473 246 43 9
12 2714 241 47 4
13 2925 452 49 6

The weekly code statistics need to be fused into a single table.

201421123042 Java Programming Week 12th

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.