Answered step by step
Verified Expert Solution
Question
1 Approved Answer
8. (4 marks) Create a java program for accepting the dealer details. The application should accept the dealer details such as name, address, phone
8. (4 marks) Create a java program for accepting the dealer details. The application should accept the dealer details such as name, address, phone number and services offered by the dealer. The dealer detail should be recorded in a file called dealerdetails.txt. This program should use a Serializable interface. The dealer detail will be hardcoded within the program and will not require user input via keyboard(scanner). The dealer details are shown within the program as shown in the program upon running it. Program output: Name: John Curtis Address: 84 Rose Street Springwood NSW 2777 Phone number: 0401566788 Services: Delivery REQUIREMENTS Application class: Implements Serializable It has 4 data fields - String name; String address; String phoneno; String services; . It has one constructor that takes 4 arguments, i.e., application (String name, String address, String phoneno, String services). It has print_details () that prints Name, Address, Phone number and Services on al separate line. Dealerdetail Inputs the hardcoded dealer details using a constructor application ("John Curtis", "84 Rose Street Springwood NSW 2777 ", "0401566788", "delivery") Write and save the dealer details into text file called dealerdetails.txt. Use FileInputStream, FileOutputStream, ObjectOutputStream and ObjectInputStream. Your code must work exactly the same as the specification with the program output as shown and should create a file called dealerdetails.txt in the program directory upon running it. Example of the program output: Name: John Curtis Address: 84 Rose Street Springwood NSW 2777 Phone number: 0401566788 Services: Delivery
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Applicationjava 1 2 3 4 5 7 9 10 11 12 13 14 15 249689872289 16 ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started