![Computers and Technology](/tpl/images/cats/informatica.png)
Computers and Technology, 20.02.2020 08:32, cmaya
/*Implement a class Address . An address has a house number, a street, an optional
apartment number, a city, a state, and a postal code. Supply two constructors: one
with an apartment number and one without. Supply a print method that prints the
address with the street on one line and the city, state, and zip code on the next line.
Supply a method public boolean comesBefore(Address other) that tests whether this
address comes before another when the addresses are compared by postal code.*/
public class P8_04 {
int houseNumber;
String street;
int apartmentNumber;
String city;
String state;
int postalCode;
public P8_04(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 P8_04(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 House number: %s \n", this. street, this. houseNumber);
System. out. printf("City: %s State: %s Postal Code: %d\n", this. city, this. state, this. postalCode);
}
public boolean comesBefore(P8_04 other) {
if (this. postalCode < other. postalCode) {
return true;
} else {
return false;
}
}
}
![answer](/tpl/images/cats/otvet.png)
Answers: 2
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 21:50, carter4026
The use of phrases, fragments, and punctuation can influence the mood of a passage; keeping this in mind, how would you describe the mood of the followingpassage? "fog on the essex marshes, fog on the kentish heights, fog creeping into the cabooses of collier-brigs; fog lying out on the yards, and hovering in the riggingof great ships; fog drooping on the gunwales of barges and small boats. fog in the eyes and throats of ancient greenwich pensioners, wheezing by thefiresides of their wards; fog in the stem and bowl of the afternoon pipe of the wrathful skipper; fog cruelly pinching the toes and fingers of his shivering little'prentice boy on deck." (5 points)
Answers: 2
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 25.06.2019 01:30, 91miketaylor
The study of how to design software, solve problems such as computer security threats, or come up with better ways of handling data storage
Answers: 1
Do you know the correct answer?
/*Implement a class Address . An address has a house number, a street, an optional
apartment...
apartment...
Questions in other subjects:
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/biologiya.png)
![Konu](/tpl/images/cats/istoriya.png)
History, 15.10.2019 20:30
![Konu](/tpl/images/cats/istoriya.png)
History, 15.10.2019 20:30
![Konu](/tpl/images/cats/himiya.png)
Chemistry, 15.10.2019 20:30
![Konu](/tpl/images/cats/istoriya.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 15.10.2019 20:30
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 15.10.2019 20:30