Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel 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
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.
Why are there so many functions in iostream and fstream with the same name? When is it beneficial to rename functions?
Suppose that a binary file contains exactly three numbers written to the file using the method writeDouble of the class ObjectOutputStream. Suppose further that you write a program to read all three numbers using three invocations of the method readDouble of the class ObjectInputStream. If your program invokes readDouble a fourth time, what will happen?
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
- what is ifstream class ?arrow_forwardIN JAVA Which XXX allows information to be written to a file using print( )? FileOutputStream foStream = null; PrintWriter outFS = null; foStream = new FileOutputStream("outfile.txt");XXXoutFS.println("Java is my favorite language!"); A. outFS = new PrintWriter("outfile.txt"); B. new PrintWriter(foStream); C. outFS = PrintWriter.open(foStream); D. outFS = new PrintWriter(foStream);arrow_forwardusing java: Write a Server-Client application hosting several methods on the Server-side while the Client-side makes the requests through RMI.Part I Write two methods for: (1) adding a new student to the lecture and (2) findthe lowest grade taken in the lecture.Part II Write two methods for reading/saving the lecture in a serial file.Part III Write Server side class for providing the methods in the API.arrow_forward
- What is the error in readFile()? publicvoidreadFile(){FileInputStream fbStream = null; Scanner inFS = null; int value = 0; fbStream = new FileInputStream("data.txt");inFS = new Scanner(fbStream);value = inFS.nextInt();System.out.println("Value: " + value);fbStream.close(); } a. There is a data input mismatch b. readFile( ) does not throw IOException c. inFS is not closed d. The code has no errors JAVAarrow_forwardWhat is the difference between a stream and a block cypher?arrow_forwardWhat is the purpose of using BufferedInputStream and BufferedOutputStream classes?arrow_forward
- I have the following details on my JSON file, and I want my JAVA code to keep it even after restarting the server. Please let me know how I can prevent my program from overwriting the contents of my JSON code. [ "User" {"First name": "Juan" , "Middle name": :Dela", "Last name" : "Cruz", "Username" : ""Juan123", "Password" : "1234"} ]arrow_forwardThis is sample data from my JSON file: "firstName" : "Juan","middleName" : "Dela""lastName" : "Cruz","username" : "JuanDelaCruz","password" : "1234", I already have a JAVA GUI that displays the data of each user in a table format. I need the part of my program that will allow the server to either accept or reject the user. If the user is accepted, the credentials of the user will be saved in another JSON file. If rejected, the server will do nothing.arrow_forwardCreate a .txt file with X, Y and Z having many and different data in your desktop. Read the file in java eclipse and upload the given data in database table name X, Y, Z using java.arrow_forward
- Your client owns a bookstore, and you will find attached; a text file called Samsbooks.txt withtitles of all the books in the store. Write and Print all the duplicate titles to a file calledSamsDuplicate.txt.arrow_forwardRunning a flawed software has unknown repercussions. What will happen after the code for frmProgram is written? Is it possible to display the event handler for the command button? What exactly does the Unload Me statement serve? Why is it necessary to have executable files?arrow_forwardMCQ: Which class waits for requests to come from the clients. It performs some operation based on that request, and then possibly returns a result to the client? DatagramSocket class ServerSocket class DatagramPacket class Socket classarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT