Respuesta :
Answer:
Java.
Explanation:
public class Address {
int houseNumber;
String street;
int apartmentNumber;
String city;
String state;
int postalCode;
public Address(int houseNumber, String street, String city, String state, int postalCode) {
this.houseNumber = houseNumber;
this.street = street;
this.city = city;
this.state = state;
this.postalCode = postalCode;
}
public Address(int houseNumber, String street, int apartmentNumber, String city, String state, int postalCode) {
this(houseNumber, street, city, state, postalCode);
this.apartmentNumber = apartmentNumber;
}
public void printAddress() {
System.out.printf("Street: %s%n", this.street);
System.out.printf("City: %s, State: %s, Postal Code: %d.%n", this.city, this.state, this.postalCode);
}
public boolean comesBefore(Address other) {
if (this.postalCode < other.postalCode) {
return true;
}
else {
return false;
}
}
}
The few changes I made are in bold.
In this exercise we want to use computer and Java knowledge to write the code correctly, so it is necessary to add the following to the informed code:
The code given in the image is the final answer to this question
To facilitate the code and a possible copy will be rewritten below as:
public class Address {
int houseNumber;
String street;
int apartmentNumber;
String city;
String state;
int postalCode;
}
public Address(int houseNumber, String street, String city, String state, int postalCode) {
this.houseNumber = houseNumber;
this.street = street;
this.city = city;
this.state = state;
this.postalCode = postalCode;
}
public Address(int houseNumber, String street, int apartmentNumber, String city, String state, int postalCode) {
this(houseNumber, street, city, state, postalCode);
this.apartmentNumber = apartmentNumber;
}
public void printAddress() {
System.out.printf("Street: %s%n", this.street);
System.out.printf("City: %s, State: %s, Postal Code: %d.%n", this.city, this.state, this.postalCode);
}
public boolean comesBefore(Address other) {
if (this.postalCode < other.postalCode) {
return true;
}
else {
return false;
}
}
}
See more about computer at brainly.com/question/950632
