Cannot Find Symbol

I get this error when I try to run my code.

C:\Documents and Settings\Jason\My Documents\TSM\MyArrayList.java:89: cannot find symbol

symbol : method newCity(java.lang.String,double)

location: class MyArrayList<T>

newCity(name, distance);

^

1 error

This is where it happens.

int size = list2.size();

City[] cityList = (City[]) list2.toArray();

ArrayList<City> cityList2 =new ArrayList<City>();

String name =new String();

City newCity;

double distance;

for (int i = 0; i < size; i++){

name = cityList[i].getName();

distance = currentCity.getDistance(cityList[i]);

>>>newCity(name, distance);

cityList2.add(newCity);

}

But City has a constructor for that.

public City(String name,double distance){

this.name = name;

this.distance = distance;

}

What's wrong?

Message was edited by:

bronzey214

[1360 byte] By [bronzey214a] at [2007-11-26 18:36:53]
# 1
I think the line needs to readnewCity = new City(name, distance);
atmguya at 2007-7-9 6:10:56 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...