-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathState.java
99 lines (77 loc) · 2.66 KB
/
State.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
* State
*/
public class State {
private class City {
private String cityName;
private int population;
}
private String nameOfState;
private int population;
private City capitalCity = new City();
private City populousCity = new City();
public State() {
this.nameOfState = "Nevada";
this.population = 20000044;
this.capitalCity.cityName = "Sofia";
this.capitalCity.population = 7000000;
this.populousCity.cityName = "Gorna Oryahovitsa";
this.populousCity.population = 30;
}
public State(String nameOfState, int populationOfState, String capitalCityName, int capitalCityPopulation, String populousCityName, int populousCityPopulation) {
this.nameOfState = nameOfState;
this.population = populationOfState;
this.capitalCity.cityName = capitalCityName;
this.capitalCity.population = capitalCityPopulation;
this.populousCity.cityName = populousCityName;
this.populousCity.population = populousCityPopulation;
}
public String getNameOfState() {
return nameOfState;
}
public int getPopulation() {
return population;
}
public City getCapitalCity() {
return capitalCity;
}
public String getCapitalCityName() {
return capitalCity.cityName;
}
public int getCapitalCityPopulation() {
return capitalCity.population;
}
public City getPopulousCity() {
return populousCity;
}
public String getPopulousCityName() {
return populousCity.cityName;
}
public int getPopulousCityPopulation() {
return populousCity.population;
}
public void setNameOfState(String nameOfState) {
this.nameOfState = nameOfState;
}
public void setPopulation(int population) {
this.population = population;
}
public void setCapitalCity(City capitalCity){
this.capitalCity = capitalCity;
}
public void setCapitalCityName(String capitalCityName) {
this.capitalCity.cityName = capitalCityName;
}
public void setCapitalCityPopulation(int capitalCitypopulation) {
this.capitalCity.population = capitalCitypopulation;
}
public void setPopulousCity(City populousCity) {
this.populousCity = populousCity;
}
public void setPopulousCityName(String populousCityName) {
this.populousCity.cityName = populousCityName;
}
public void setPopulousCityPopulation(int populousCityPopulation) {
this.populousCity.population = populousCityPopulation;
}
}