Question
Write Java program for the given question : Create AddressBook class with the attributes private long phoneNumber private AddresstempAddress private AddresspermAddress Include appropriate getter and
Write Java program for the given question :
CreateAddressBookclass with the attributes
private long phoneNumber
private AddresstempAddress
private AddresspermAddress
Include appropriate getter and setter methods for the above attributes.
CreateAddressclass with the private attributes
String name, street, city, state.
Include appropriate getter and setter methods for the above attributes.
The Address class must be available only to AddressBook class. So the Address class should come as a Inner classs in AddessBook class.
Test the application by creating AddressBook object and print permanent ,temporary address and phone number in the main method.
Sample Input
Enter the permanent address
Enter the house name
Maya Illam
Enter the street
1st street
Enter the city
chennai
Enter the state
tamilnadu
Enter the temporary address
Enter the house name
May flower
Enter the street
2nd street
Enter the city
coimbatore
Enter the state
tamilnadu
Enter the phone number
9874561230
Sample output
Permanent address
House name:Maya Illam
Street:1st street
City:chennai
State:tamilnadu
Temporary address
House name:May flower
Street:2nd street
City:coimbatore
State:tamilnadu
Phone number
9874561230
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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