Results 1 to 4 of 4
  1. #1
    tnt417 is offline Member
    Join Date
    Sep 2015
    Posts
    21
    Rep Power
    0

    Question Enum Error? HELP ME

    I have this error with enums
    it the error is: "The constructor ID() is undefined."
    Code:
    Java Code:
    package com.test.main;
    
    public enum ID {
    	Player(),
        Trail(),
        BasicEnemy();
        
    
        
        
    
        private ID(String string2, int n2) {
        }
    }

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Enum Error? HELP ME

    What source line is that error message on?
    Can you copy the full text of the error message and paste it here?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Enum Error? HELP ME

    You might also check out the tutorials.

    Java Tutorials - Enums
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default Re: Enum Error? HELP ME

    You created a constructor yourself in line #12; it takes a String and an int as parameters, so the compiler won't generate a no-arg constructor for you ...

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. Replies: 3
    Last Post: 01-20-2013, 08:06 PM
  2. Replies: 1
    Last Post: 10-03-2012, 09:38 PM
  3. class interface or enum expected Imports java.io.*; error
    By prathamkool in forum New To Java
    Replies: 2
    Last Post: 10-02-2011, 04:53 PM
  4. Replies: 2
    Last Post: 10-02-2010, 02:13 AM
  5. Enum Error in JDK 1.6
    By nani5swamy in forum Advanced Java
    Replies: 1
    Last Post: 01-04-2008, 11:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •