Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

Add a method called save to your Person class. This method will write the object out to a binary file. Use the Serializeable format. Name the file accountNumber.dat where accountNumber is the credit card number from the object.

Code in Java

/////////////////FIles given (Demo.java) \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

import java.util.ArrayList;
import java.util.Collections;

public class Demo {
public static void main(String[] args) {
Person test1 = new Person("Eachelle Balderstone",
30526110612015L,
9866.30,
false);

Person test2 = new Person("Brand Hallam",
3573877643495486L,
9985.21,
false);

Person test3 = new Person("Tiphanie Oland",
5100172198301454L,
9315.15,
true);

ArrayList<Person> list = new ArrayList<>();
list.add(test1);
list.add(test2);
list.add(test3);
Collections.sort(list);

System.out.printf("%20s%20s%10s%10s\n", "Name", "Account Number", "Balance", "Cash Back");
for (Person current : list) {
System.out.println(current);
}
}
}

Transcribed Image Text:Test Case 1 Enter file name \n 30526110612015.dat ENTER Eachelle Balderstone 30526110612015 9866.30 No \n Test Case 2 Enter file name \n 3573877643495486. dat ENTER Brand Hallam 3573877643495486 9985.21 No \n Test Case 3 Enter file name \n 5100172198301454. dat ENTER Tiphanie 0land 5100172198301454 9315.15 Yes \n
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
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
    SEE MORE QUESTIONS
    Recommended textbooks for you
    Text book image
    Database System Concepts
    Computer Science
    ISBN:9780078022159
    Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
    Publisher:McGraw-Hill Education
    Text book image
    Starting Out with Python (4th Edition)
    Computer Science
    ISBN:9780134444321
    Author:Tony Gaddis
    Publisher:PEARSON
    Text book image
    Digital Fundamentals (11th Edition)
    Computer Science
    ISBN:9780132737968
    Author:Thomas L. Floyd
    Publisher:PEARSON
    Text book image
    C How to Program (8th Edition)
    Computer Science
    ISBN:9780133976892
    Author:Paul J. Deitel, Harvey Deitel
    Publisher:PEARSON
    Text book image
    Database Systems: Design, Implementation, & Manag...
    Computer Science
    ISBN:9781337627900
    Author:Carlos Coronel, Steven Morris
    Publisher:Cengage Learning
    Text book image
    Programmable Logic Controllers
    Computer Science
    ISBN:9780073373843
    Author:Frank D. Petruzella
    Publisher:McGraw-Hill Education