Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.HashMap;
- public class Main {
- public static void main(String[] args) {
- HashMap<String, Country> countries = new HashMap<>();
- countries = initiateCountries();
- HashMap<String, PostOffice> POs = new HashMap<>();
- POs = initiatePostOffices();
- Address horiAddress = new Address("Hori Nibash","Green City", "Hawlderpara", "Sylhet", countries.get("Bangladesh"));
- Recipient hori = new Recipient("Horipriya Das Arpita", "01550050058", "hori68@gmail.com", horiAddress);
- Address priyaAddress = new Address("Priyar It er Ghor", "Lake City", "Sillicon Valley", "California", countries.get("USA"));
- Recipient priya = new Recipient("Jerin Hasan Priya", "99999999", "priya_dushtu@gmail.com", priyaAddress);
- Address promiAddress = new Address("Sanzida Bagh Kella", "Lalbagh",POs.get("Sylhet Head Post Office"),"Dhaka",countries.get("Bangladesh"));
- Recipient promi = new Recipient("Sanzida Afrin Promi", "12345678", "sanzida_promi@gmail.com", promiAddress);
- hori.getRecipient();
- priya.getRecipient();
- promi.getRecipient();
- }
- private static HashMap<String, Country> initiateCountries() {
- HashMap<String, Country> countries = new HashMap<>();
- Country country;
- country = new Country("Bangladesh", "+880", "Asia");
- countries.put("Bangladesh", country);
- country = new Country("India", "+091", "Asia");
- countries.put("India", country);
- country = new Country("Myanmar", "+123", "Asia");
- countries.put("Myanmar", country);
- country = new Country("USA", "+001", "North America");
- countries.put("USA", country);
- country = new Country("Germany", "+666", "Europe");
- countries.put("Germany", country);
- country = new Country("Russia", "+999", "Russia");
- countries.put("Russia", country);
- return countries;
- }
- private static HashMap<String, PostOffice> initiatePostOffices() {
- HashMap<String, PostOffice> POs = new HashMap<>();
- PostOffice PO;
- PO = new PostOffice("Sylhet Head Post Office", "Tamabil", "1111", "01999887338", "Sajon Baha");
- POs.put("Sylhet Head Post Office", PO);
- PO = new PostOffice("New Market Post Office", "New Market", "1205");
- POs.put("New Market Post Office", PO);
- PO = new PostOffice("Sub-Post office, SUST", "Akhalia", "2222");
- POs.put("Sub-Post office, SUST", PO);
- PO = new PostOffice("Putin bhai er post office", "Moscow", "9999");
- POs.put("Sub-Post office, SUST", PO);
- return POs;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement