我試圖一個開發application..following是一個片段Android的Java錯誤
class metro_nodes {
public String station;
public GeoPoint point; }
public class mainscreen extends MapActivity {
/** Called when the activity is first created. */
MapController controller;
double latitude,longitude;
LocationManager loc;
Location lastknownloc;
LocationListener loclistener;
List<GeoPoint> geopoints = new ArrayList<GeoPoint>();
MapView mapView;
private LinkedList<metro_nodes> station_location = new LinkedList<metro_nodes>();
metro_nodes anand_nagar;
anand_nagar.station = "anand_nagar";
}
現在在倒數第二行的捐贈 - 站「標誌的語法錯誤‘’,VariableDeclaratorId預計此令牌後「
如果我把大括號括在這個語句,然後錯誤得到刪除..但然後我得到java lang空指針異常... 什麼是problm?
你或許應該嘗試做的是涉及到的東西這個複雜的應用之前學習一些基本的Java。這會讓你自己更容易。 – Austin