I figured it out.
public City()
{
name = "unknown";
population = -1;
}
is what has to be put in
Type: Posts; User: jwb4291
I figured it out.
public City()
{
name = "unknown";
population = -1;
}
is what has to be put in
Yeah, that didn't work.
I tried substituting "unknown" for "New York" and -1 for 100 because thats what the prompt said but that didnt work either
Then what is the actual answer? because all i have so far is
public class City {
private String name;
private int population;
so im not sure what follows it
Here is the prompt I got-
The code below shows some of the text for a class called City. As you can see, a City has two instance variables, name and population. Write a complete public constructor...