whats wrong with my code ???
at book class is
protected Company publisher; declare as global variable public Company getPublisher() { return publisher; } public void setPublisher(Company publisher) { this.publisher=publisher; } at Company class is public final class Company { private String street; private String city; private String state; private String zip; /** Create an address with street, city, state, and zip */ public Company(String street, String city, String state, String zip) { this.street = street; this.city = city; this.state = state; this.zip = zip; } /** Return street */ public String getStreet() { return street; } /** Return city */ public String getCity() { return city; } /** Return state */ public String getState() { return state; } /** Return zip */ public String getZip() { return zip; } public void setStreet(String street) { this.street=street; } public void setCity(String city) { this.city=city; } public void setState(String state) { this.state=state; } public void setZip(String zip) { this.zip=zip; } /** Get full address */ public String getFullPublisher() { return street + '\n' + city + ", " + state + ' ' + zip + '\n'; } } at testing class is System.out.print("Enter publisher address: "); System.out.print("street > "); item[i].publisher.setStreet(scan.next()); System.out.print("city > "); item[i].publisher.setCity(scan.next()); System.out.print("state > "); item[i].publisher.setState(scan.next()); System.out.print("zip > "); item[i].publisher.setZip(scan.next());
It compile show me not error but i canno prompt the input of stree from user .