Results 1 to 3 of 3

Thread: <identifier> expected error

  1. #1
    Join Date
    Oct 2011
    Posts
    2

    <identifier> expected error

    hello.
    I have been getting this error for a while now. I'm using this file to import into another file to create a game. I'm using Dr Java and the JDK 6.0_27 compiler

    here is my line of code:

    //Block.java
    public class Block extends GraphicsProgram
    {
    RandomGenerator rg = new RandomGenerator();
    int width, low, high, ground;
    block = new GRect(40, rg);

    public Block (int w, int l, int h, int x, int g)
    {
    width = w;
    low = l;
    high = h;
    ground = g;
    }
    }

    this is my error:

    1 error found:
    File: D:\blockjumpergame\Block.java [line: 5]
    Error: D:\blockjumpergame\Block.java:5: <identifier> expected

    thank you for any help on this matter.
    Last edited by mbueling; 16-10-2011 at 10:08 PM.

  2. #2
    Join Date
    Mar 2011
    Posts
    160

    Re: <identifier> expected error

    Hello according to my knowledge this error occurs if there is any issue with the imports file. I think you forget to initialize some imports file. And even if the initialization is not proper in constructor also cause this error. I hope this will clear your some doubt. I will suggest you to refer the java docs while writing code. It will help you more.

  3. #3
    Join Date
    Oct 2011
    Posts
    2

    Re: <identifier> expected error

    thank you for your quick reply Fred I will see which import file is needed, would you happen to know if you can import with a constructor?

Similar Threads

  1. IDD_DIALOG1 error C2065 stating undeclared identifier
    By Edi in forum Software Development
    Replies: 5
    Last Post: 26-06-2011, 06:53 AM
  2. <Identifier> Expected Error Circular Linked List Java
    By JGriff254 in forum Software Development
    Replies: 1
    Last Post: 23-03-2010, 02:25 PM
  3. "Identifier Expected" error in Dr Java
    By adam.taylor in forum Software Development
    Replies: 5
    Last Post: 12-05-2009, 11:55 AM
  4. Identifier Expected Error in JAVA
    By Brake Fail in forum Software Development
    Replies: 7
    Last Post: 25-10-2008, 02:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,562,855.07113 seconds with 17 queries