Search:

Type: Posts; User: jwb4291

Search: Search took 0.10 seconds.

  1. Replies
    7
    Views
    2,401

    Re: No idea what to do for this

    I figured it out.


    public City()
    {
    name = "unknown";
    population = -1;
    }
    is what has to be put in
  2. Replies
    7
    Views
    2,401

    Re: No idea what to do for this

    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
  3. Replies
    7
    Views
    2,401

    Re: No idea what to do for this

    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
  4. Replies
    7
    Views
    2,401

    No idea what to do for this

    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...
Results 1 to 4 of 4