-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCity.java
More file actions
58 lines (48 loc) · 1.18 KB
/
City.java
File metadata and controls
58 lines (48 loc) · 1.18 KB
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
package labexcercise;
public class City {
private String cityName;
private double cityPopulation;
public City() {
// TODO Auto-generated constructor stub
this.cityName = "";
this.cityPopulation = 0;
}
public City(String cityName, double cityPopulation) {
setCityName(cityName);
setCityPopulation(cityPopulation);
}
/**
* @return the cityName
*/
public String getCityName() {
return cityName;
}
/**
* @param cityName
* the cityName to set
*/
public void setCityName(String cityName) {
this.cityName = cityName;
}
/**
* @return the cityPopulation
*/
public double getCityPopulation() {
return cityPopulation;
}
/**
* @param cityPopulation
* the cityPopulation to set
*/
public void setCityPopulation(double cityPopulation) {
this.cityPopulation = cityPopulation;
}
/*
* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "City [cityName=" + cityName + ", cityPopulation=" + cityPopulation + "]";
}
}