Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8090643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:47:25+00:00 2026-06-05T19:47:25+00:00

i am trying a develop a application..following is a snippet class metro_nodes { public

  • 0

i am trying a develop a application..following is a snippet

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";
    }

now in the second last line its giving -“Syntax error on token “station”, VariableDeclaratorId expected after this token”

if i put curly braces around this statement then error get removed..but then i get java lang null pointer exception…
whats the problm ??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:47:27+00:00Added an answer on June 5, 2026 at 7:47 pm

    You haven’t posted the code that gives you the syntax error…but I’m guessing you’re getting the null pointer exception because you never initialized any “metro_nodes” objects.

    For example:

    // This is a helper class
    class MetroNode {
      public String station;
      public GeoPoint point; 
    
      public MetroNode (String station, GeoPoint point) {
        this.station = station;
        this.point = point;
      }
    }
    
    // This is the module's main class
    public class MainScreen extends MapActivity {
    
      // This is public and private data for each class instance
      private LinkedList<MetroNode> station_location = null;
    
      // This is the activity's initialization
      public void onCreate(Bundle savedInstanceState) 
        station_locations = new LinkedList<MetroNode>();
        MetroNode metroNode = new MetroNode ("anand_nagar", new GeoPoint (1.00, 2.00));
        station_locations.add (metroNode);
      ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to develop a web application that will do the following: Collect
I'm trying to develop a cross platform application. Currently I have set up following
I'm trying to develop a WCF service in the following manner: A class library
I am trying to develop a Project Management System in my application following the
I am trying to develop an application that uses a number of images that
I am trying to develop an application that uses a number of images that
I am trying to develop an application using ADO.NET. I have two tables in
I'm trying to develop an application in Delphi XE2 that will be able to
I'm trying to develop a web application that dispatch (Dispatcher) to multiple versions of
I'm trying to develop a web application that is going to be launched from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.