Hellboyandso

Address.java

Dec 15th, 2016
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. package domain;
  2.  
  3. public class Address {
  4.  
  5.     private String street;
  6.     private String housnbr;
  7.     private String postcode;
  8.     private String city;
  9.     private String country;
  10.    
  11.     public Address(String street, String housnbr, String postcode, String city, String country) {
  12.         setStreet(street);
  13.         setHousnmb(housnbr);
  14.         setPostcode(postcode);
  15.         setCity(city);
  16.         setCountry(country);
  17.     }
  18.    
  19.     public String getStreet() {
  20.         return street;
  21.     }
  22.    
  23.     private void setStreet(String street) {
  24.         this.street = street;
  25.     }
  26.    
  27.     public String getHousnmb(){
  28.         return this.housnbr;
  29.     }
  30.    
  31.     private void setHousnmb(String housnbr){
  32.         this.housnbr = housnbr;
  33.     }
  34.    
  35.     public String getPostcode() {
  36.         return postcode;
  37.     }
  38.    
  39.     private void setPostcode(String postcode) {
  40.         this.postcode = postcode;
  41.     }
  42.    
  43.     public String getCity() {
  44.         return city;
  45.     }
  46.    
  47.     private void setCity(String city) {
  48.         this.city = city;
  49.     }
  50.    
  51.     public String getCountry() {
  52.         return country;
  53.     }
  54.    
  55.     private void setCountry(String country) {
  56.         this.country = country;
  57.     }
  58.    
  59.     @Override
  60.     public String toString(){
  61.         return this.getStreet() + " " + this.getHousnmb() + ", " + this.getPostcode() + " " + this.getCity() + ", " + this.getCountry();
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment