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 8390259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:56:08+00:00 2026-06-09T18:56:08+00:00

i have a class like that in the package map1: import android.graphics.Bitmap; public class

  • 0

i have a class like that in the package map1:

import android.graphics.Bitmap;

public class Map {

    public Bitmap Structure;

    public String name;

    public Integer ID;
}

in a different project a have the following code:

public class dummy {
    map1.Map MM = new map1.Map();
    MM.ID = 5;//this line is a error: "Syntax error on token "ID", VariableDeclaratorId expected after this token"
}

i checked the references and all is O.K. (as far as I could tell)
i have a different and there all works fine. i couldn’t find any significant difference, but I’m quite new to eclipse.

why does that happen and how do I make my second project work?

  • 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-09T18:56:10+00:00Added an answer on June 9, 2026 at 6:56 pm

    Your code is broken, basically. This statement:

    MM.ID = 5;
    

    is not inside a constructor, method, or initializer. It needs to be. For example, you might want to put it in a constructor:

    public class dummy {
        map1.Map MM = new map1.Map();
    
        public dummy() {
            MM.ID = 5;
        }
    }
    

    I suspect your other working class doesn’t have such a syntax error.

    (Aside from that, it would be a very good idea to start using private variables, avoiding clashes with standard library types such as Map, and following Java naming conventions.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Security class that looks like this: package controllers; import play.Logger; public
I have a class Client like that: public class Client { public Person Pers
I have a Client class like that: public class Client { public Person Pers
I have class that looks like this: class A { public: class variables_map vm
I have a class that looks like the following: public class MyClass { private
I have a class that looks like this: public class BasePadWI { public WorkItem
Say I have a class that looks like this (get/set omited): class InfoClass{ String
Currently I have a class that looks like this: public class MyClass : IMyClass
Suppose I have a class like this: package com.spotonsystems.bulkadmin.cognosSDK.util.Logging; public class RecordLogging implements LittleLogging{
I have class of Person : package Model; import java.util.Set; public class Person {

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.