Introduction to Java Programming and Data Structures Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134700144
Author: Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 17.6, Problem 17.6.1CP
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
what is ifstream class ?
what is ifstream objects ?
If wrong answer this time will downvote it
Create a class with a static main that tests the ability to resolve and print a Path:
• Create an instance of a FileSystem class.
• Resolve an instance of a Path interface from a directory path and filename.
• Print the constructed Path with System.out.println() method.
2. Create a class with a static main that tests the ability to resolve and print a Path:
• Create an array of Path class.
• Instantiate instances of Path with absolute and relative paths.
• Print the constructed elements of the array of Path class with System.out.println() method.
3. Create a class to test serialisation class that implements serializable, it should implement the following:
• A static void method that serialises an object.
• A static void method that deserializes an object.
• A static main method that tests the two by moving an object from one to the other
Chapter 17 Solutions
Introduction to Java Programming and Data Structures Comprehensive Version (11th 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
Similar questions
- Which of the following are true? The Serializable interface has no methods. The Serializable method has been deprecated (fallen into disfavor) because it transmits data as a byte stream. All classes implement the Serializable interface by default. a and b are both true.arrow_forwardwhat is ifstream file ?arrow_forwardPrintWriter and Scanner - text file I/O DataInputStream and DataOutputStream - binary file I/O RandomAccessFile - binary file i/o where every record is the same number of bytes so that you can seek to a specific record ObjectInputStream and ObjectOutputStream - read and write objects.arrow_forward
- In Java, the File class is used to represent the data in a directory entry. Write a program that uses the File class to print all the attributes of a file.arrow_forwardWrite a program that generates student records in a database file. Your program should be able to generate at least 10 records. The format in the database should be: student name, student id The first student id should be 20180001, second id will be 20180001 and so forth. Show screenshot of scriptarrow_forwardComputing And Software Systemsarrow_forward
- The getSelectedFile method of a JFileChooser object returns a File object. What exactly is this File object? A string containing a file name, a disk file, something else?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_forwardRead the user's name followed by the user's age from the keyboard (standard input). Then use an ofstream object named outdata to write this information separated by a space into a file called outdata. Declare any variables that you need. Be sure to close the file when you are finished writing data to it.arrow_forward
- Shell scriptarrow_forwardWrite a program that generates student records in a database file. Your program should be able to generate at least 10 records. The format in the database should be: student name, student id The first student id should be 20180001, second id will be 20180001 and so forth.arrow_forwardCreate a binary interface for your application.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT