Introduction to Java Programming and Data Structures: Brief Version (11th Global Edition)
11th Edition
ISBN: 9780134671710
Author: Y. Daniel Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 17.6, Problem 17.6.4CP
Program Plan Intro
ObjectInputStream/ObjectOuputStream:
The “ObjectInputStream/ObjectOuputStream” classes are used to read/ write serializable objects. It is used to perform I/O for objects in additions to primitive-type values and strings, “DataInputStream/DataOutputStream” can be replaced with the “ObjectInputStream / ObjectOuputStream”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
This is for Java. Please help. Thanks
True or False?
Instantiating an array of objects reserves room to store references only.
1. The append() method concatenates the string representation of any other type of data tothe end of the invoking StringBuffer object. It has several overloaded versions. Here are afew of its forms:StringBuffer append(String str)StringBuffer append(int num)StringBuffer append(Object obj)2. The result is appended to the current StringBuffer object.3. The buffer itself is returned by each version of append( ).4. This allows subsequent calls to be chained together, write java code for it
Chapter 17 Solutions
Introduction to Java Programming and Data Structures: Brief Version (11th Global Edition)
Ch. 17.2 - What is a text file and what is a binary file? Can...Ch. 17.2 - How do you read or write text data in Java? What...Ch. 17.3 - Prob. 17.3.1CPCh. 17.3 - How is a Java character represented in the memory,...Ch. 17.3 - If you write the string ABC to an ASCII text file,...Ch. 17.3 - If you write the string 100 to an ASCII text file,...Ch. 17.3 - What is the encoding scheme for representing a...Ch. 17.4 - Prob. 17.4.1CPCh. 17.4 - Why should you always close streams? How do you...Ch. 17.4 - Prob. 17.4.3CP
Ch. 17.4 - Does FileInputStream/Fi1eOutputStream introduce...Ch. 17.4 - What will happen if you attempt to create an input...Ch. 17.4 - How do you append data to an existing text file...Ch. 17.4 - Prob. 17.4.7CPCh. 17.4 - What is written to a file using writeByte(91) on a...Ch. 17.4 - How do you check the end of a file in an input...Ch. 17.4 - What is wrong in the following code? Import...Ch. 17.4 - Suppose you run the following program on Windows...Ch. 17.4 - After the following program is finished, how many...Ch. 17.4 - For each of the following statements on a...Ch. 17.4 - What are the advantages of using buffered streams?...Ch. 17.5 - How does the program check if a file already...Ch. 17.5 - How does the program detect the end of the file...Ch. 17.5 - How does the program count the number of bytes...Ch. 17.6 - Prob. 17.6.1CPCh. 17.6 - Prob. 17.6.2CPCh. 17.6 - Is it true that any instance of...Ch. 17.6 - Prob. 17.6.4CPCh. 17.6 - Prob. 17.6.5CPCh. 17.6 - What will happen when you attempt to run the...Ch. 17.7 - Can RandomAccessFi1e streams read and write a data...Ch. 17.7 - Create a RandomAccessFi1e stream for the file...Ch. 17.7 - What happens if the file test.dat does not exist...Ch. 17 - (Create a text file) Write a program to create a...Ch. 17 - (Create a binary data file) Write a program to...Ch. 17 - (Sum all the integers in a binary data file)...Ch. 17 - (Convert a text file into UTF) Write a program...Ch. 17 - Prob. 17.5PECh. 17 - Prob. 17.6PECh. 17 - Prob. 17.7PECh. 17 - (Update count) Suppose that you wish to track how...Ch. 17 - (Address book) Write a program that stores,...Ch. 17 - (Split files) Suppose you want to back up a huge...Ch. 17 - (Split files GUI) Rewrite Exercise 17.10 with a...Ch. 17 - Prob. 17.12PECh. 17 - (Combine files GUI) Rewrite Exercise 17.12 with a...Ch. 17 - (Encrypt files) Encode the file by adding 5 to...Ch. 17 - (Decrypt files) Suppose a file is encrypted using...Ch. 17 - (Frequency of characters) Write a program that...Ch. 17 - (BitOutputStream) Implement a class named...Ch. 17 - (View bits) Write the following method that...Ch. 17 - (View hex) Write a program that prompts the user...Ch. 17 - (Hex editor) Write a GUI application that lets the...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Take a close look at the C++ code in IntCollection.zip (Copy and Paste link to the external site http://fog.ccsf.edu/~mluttrel/cs110b/IntCollection.zip ) on my web site. The IntCollection class is a dynamic storage mechanism for storing integers. It could be used in place of an integer array. The following code creates an IntCollection object named ‘c’. It adds seven integers to ‘c’, then uses a for loop to display the seven integers: int main(){IntCollection c;c.add(45);c.add(-210);c.add(77);c.add(2);c.add(-21);c.add(42);c.add(7);for (int i = 0; i < c.getSize(); i++){ cout << c.get(i) << endl;}} For this assignment you will add a copy constructor, a destructor, and three overloaded operators to the IntCollection class. In the design diagram below, the black member functions represent code that has already been implemented. You will be implementing the green items. Each item that you will be adding to the class is described below the diagram. private:…arrow_forward1. Copy some text from a news article, paste it in the Notepad++ editor and save it in a textfile named testtext.txt;2. Write a Java program to read the words in the text file into an ArrayList object,display the information about how many words there are in the text file, and display thewords in the order they appear in the text file. Then sort the array and display the sortedarray. Take a screenshot of the output window.3. Submit your text file, the screenshot, and the Java source code filearrow_forwardIn Java programming Write the code to print out an inventory report. Your code must read each inventory item from a file, populate the object, place the object in a linked list, and display the data by reading from the linked list after all items have been added. Use the inventory object name from Inventory inventory = new Inventory ( “inventory“); Assume you have opened a file and read a line into the inventory object Write the signature line for this method Write the line of code that will print the inventory object properties. Be sure to include a textual description of each property.arrow_forward
- The goal for Lab06a is to use the provided Student class and create an array of Student objects that are stored in a School object. This program uses a Student class that is provided See the work area. The class is placed in its own separate file and should not be altered. The Lab06avst.java file is also provided for you in the work area. You will not see the Student class here. There is evidence that the Student class is used, as you see in line 17, but the class is separate in its own file, which is better Object Oriented Design. Specifics and Output 10 Student objects need to be constructed and placed in a students array, which is stored in a School object. The actual data used in the Student objects can be seen by the output below. This program requires the completion of the School constructor. It also requires the completion of the addData method. This method does a lot. First you need to create three initializer lists for names, ages and gpas. These arrays are only used to…arrow_forwardI have a text file that have a list of employee's Id and name correspond to it. All the IDs are unique. What I want to do is I want to read from the text file and then sort the Id in order then put it back into the text file. How can I do this in java? Can you write a code for it in java. For example: the text file text.txt contains Id Name 3 Kark 1 Mia 5 Tyrus 2 John After sort, the text.txt will be 1 Mia 2 John 3 Karl 5 Tyrusarrow_forwardWrite a Java program that simulates a basic library delivery system. The user of the program will beable to add different types of items to library collection. In your program, as the main data structure,use the generic collection class ArrayList to store String references.Create three instances from ArrayList of String references. The first one will store the types, thesecond one will store the items, and the third one will store the owners of the items. The types areexactly the following: "Book", "DVD", "Magazine". The items and their owners will be read fromthe keyboard.Regarding the matching between an item and its owner, the location (index value) of an item in thelist of items will be the same with the location of its corresponding owner in the list of owners.As the next step, create the fourth instance from ArrayList of String references and call this list asitemsDeliveredByOwners. This last list will store String references to indicate the owners ofthe items (such as the…arrow_forward
- The goal for Lab07 is to use the provided Student class and create an array of Student objects that is stored in a School object. This program uses a Student class that is provided(picture attached!). The class is placed in its own separate file and should not be altered. This project started with Lab06a and uses the same Student class. Part one of Lab07 is similar to the Lab06b. The difference is that Lab06b used static 1D arrays and Lab07 uses dynamic ArrayList arrays. The output is the same. OUTPUT Tom 21 1.685 Ann 34 3.875 Bob 18 2.5 Jan 45 4.0 Joe 27 2.975 Sue 19 3.225 Jay 30 3.65 Meg 38 2.0 Art 40 3.999 Deb 35 2.125 Ann 34 3.875 Art 40 3.999 Bob 18 2.5 Deb 35 2.125 Jan 45 4.0 Jay 30 3.65 Joe 27 2.975 Meg 38 2.0 Sue 19 3.225 Tom 21 1.685 Bob 18 2.5 Sue 19 3.225 Tom 21 1.685 Joe 27 2.975 Jay 30 3.65 Ann 34 3.875 Deb 35 2.125 Meg 38 2.0 Art 40 3.999 Jan 45 4.0 Tom 21 1.685 Meg 38 2.0 Deb 35 2.125 Bob 18 2.5 Joe…arrow_forwardThe goal for Lab07 is to use the provided Student class and create an array of Student objects that is stored in a School object. This program uses a Student class that is provided(picture attached!). The class is placed in its own separate file and should not be altered. This project started with Lab06a and uses the same Student class. Part one of Lab07 is similar to the Lab06b. The difference is that Lab06b used static 1D arrays and Lab07 uses dynamic ArrayList arrays. The output is the same. In part two, adds the linearSearch and the binarySearch methods. Each search method is tested with an existing search record and one that does not exist. Tom 21 1.685 Ann 34 3.875 Bob 18 2.5 Jan 45 4.0 Joe 27 2.975 Sue 19 3.225 Jay 30 3.65 Meg 38 2.0 Art 40 3.999 Deb 35 2.125 7 -1 Ann 34 3.875 Art 40 3.999 Bob 18 2.5 Deb 35 2.125 Jan 45 4.0 Jay 30 3.65 Joe 27 2.975 Meg 38 2.0 Sue 19 3.225 Tom 21 1.685 7 -1arrow_forwardThe goal for Lab07 is to use the provided Student class and create an array of Student objects that is stored in a School object. This program uses a Student class that is provided(picture attached!). The class is placed in its own separate file and should not be altered. This project started with Lab06a and uses the same Student class. Part one of Lab07 is similar to the Lab06b. The difference is that Lab06b used static 1D arrays and Lab07 uses dynamic ArrayList arrays. The output is the same. Tom 21 1.685 Ann 34 3.875 Bob 18 2.5 Jan 45 4.0 Joe 27 2.975 Sue 19 3.225 Jay 30 3.65 Meg 38 2.0 Art 40 3.999 Deb 35 2.125 Ann 34 3.875 Art 40 3.999 Bob 18 2.5 Deb 35 2.125 Jan 45 4.0 Jay 30 3.65 Joe 27 2.975 Meg 38 2.0 Sue 19 3.225 Tom 21 1.685 Bob 18 2.5 Sue 19 3.225 Tom 21 1.685 Joe 27 2.975 Jay 30 3.65 Ann 34 3.875 Deb 35 2.125 Meg 38 2.0 Art 40 3.999 Jan 45 4.0 Tom 21 1.685 Meg 38 2.0 Deb 35 2.125 Bob 18 2.5 Joe 27 2.975…arrow_forward
- How do I extract data from a JSON Object? I am working on a project that requires me to extract the pop and name of a city. How would I set this up ? { "count": 1362963, "results": [ { "createdAt": "2019-12-09T21:04:56.736Z", "name": "la Massana", "adminCode": "04", "objectId": "JJfZWgGdZu", "population": 7211, "updatedAt": "2019-12-09T21:04:56.736Z" }, { "createdAt": "2019-12-09T21:04:56.736Z", "name": "les Escaldes", "adminCode": "08", "objectId": "PfCHLgNgxW", "population": 15853, "updatedAt": "2019-12-09T21:04:56.736Z" },arrow_forwardIn Java programming Write the code to print out a customer report. Your code must read each customer from a file, populate the object, place the object in a linked list, and display the data from the linked list. Use the customer object name from Customer customer = new Customer ( “ customer name” ); Assume you have opened a file and read a line into the customer object. Write the signature line for this method Write the line of code that will write the object to a linked list Write the line of code that will print the customer object properties. Be sure to include a textual description of each property.arrow_forwardConsider that a database is hosted online with the following URL: https://csci410androidstudio2022.000webhostapp.com/getSportTypes.php It returns a JSON array which contains many JSON objects. Each object contains: id and name. These fields are case sensitive so remember to type them correctly. It will return something as follows: {"id":1,"name":"Soccer"}, {"id":2,"name":"Basketball"} Fill in the spinner entries using the URL already mentioned. A- When user press on 'Add new team' Button, a new activity should appear as follow: rox NoxPlayer 70.16 OX« 8:51 A My Application Team name Number of players Soccer Basketbal ADD TEAM The layout created previously contains a Spinner to choose a sport type, and two EditTexts first one has the following hint 'Team Name' and the second 'Number of players' and a Button called 'Add Team'. When the user press on this button, a new record is saved.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education