getFullAddress() should return the address as a formatted String, one item per line:
e.g. 23 High Street
Newcastle
NE1 1NE // There should be a space between the two parts of the postcode.
how i can get done of this return?
public class Address { private String postcode; private String street; private String town; /** * Constructor for objects of class Address. * *@param street The Address's Street *@param town The Address's Town *@param postcode The Address's Postcode */ public Address (String street , String town , String postcode) { this.street = street; this.town = town; this.postcode = postcode; } // accessors /** * Get the Address's FullAddress * * @return the address as a formatted String, one item per line */ public String getFullAddress() { String fullAddress = "street/n" + "town/n" + "postcode"; return fullAddress; } /** * Get the Address's Postcode * * @return the Address's Postcode */ public String getPostcode() { return postcode; } /** * Get the Address's Street * * @return the Address's Street */ public String getStreet() { return street; } /** * Get the Address's Town * * @return the Address's Town */ public String getTown() { return town; } /** * Print out the Address to the console window * */ public void printAddress() { System.out.println(street + "\n" + town + "\n" + postcode); } //mutators /** * Change the Address's street,town and postcode * * @param street the street * @param town the town * @param postcode the postcode */ public void setFullAddress (String street , String town , String postcode) { this.street = street ; this.town = town; this.postcode = postcode; } /** * Change the Address's postcode * * @param postcode the postcode */ public void setPostcode (String postcode) { this.postcode = postcode; } /** * Change the Address's street * * @param postcode the street */ public void setStreet (String street) { this.street = street; } /** * Change the Address's town * * @param postcode the town */ public void setTown (String town) { this.town = town; } //End Class }