Compiler complaining about superclass' constructor not present in subclass

I have a class Map and two subclasses from it, WorldMap and DungeonMap. When I compile the file, I get two errors, both the same thing.
cannot find symbol
symbol : constructor Map()
The two lines with errors are marked out in the following code. They are the opening brace for WorldMap and the first line of DungeonMap's constructor.
public class Map implements Serializable
     protected int maxX = 0,
          maxY = 0;
     public int[][] elevation = null;
     public int[][] terrain = null;
     Map(int xSize, int ySize)
          maxX = xSize - 1;
          maxY = ySize - 1;
          elevation = new int[xSize][ySize];
          terrain = new int[xSize][ySize];
     a bunch of other methods down here
class WorldMap extends Map  // first error points to this line
class DungeonMap extends Map
     DungeonMap(int xSize, int ySize)
     {  // second error points to this line, just the single brace
          ...Thanks in advance for any help rendered, it's much appreciated.

filestream wrote:
2. A class that has no constructors is given exactly one.
A default, no argument costructor of public access.The access level is the same as the access level of the class itself:
import java.lang.reflect.*;
public class Outer {
    static class Base {}
    public static class A extends Base{}
    protected static class B extends Base{}
    static class C extends Base{}
    private static class D extends Base{}
    public static void main(String[] args) {
        examine(Base.class);
        examine(A.class);
        examine(B.class);
        examine(C.class);
        examine(D.class);
    static void examine(Class<?> cls) {
        for(Constructor<?> cons : cls.getDeclaredConstructors()) {
            System.out.println(Modifier.toString(cons.getModifiers()) + " " + cls.getName());
}

Similar Messages

  • Why is compiler complaining about DatagramSocketDataEvent?

    I am trying to use the new UDP datagram API's that come in AIR 2.  However when I try to compile sample code from the web, in a very short program, I get a compiler error.  First why is this error occurring, and how come the compiler doesn't show the new AIr 2 API's.  I have flash cs4, is there something I can do to update the syntax coloring part of the editor to recognize Air2 APIs?
    import flash.net.NetworkInfo;
        import flash.net.NetworkInterface;
        import flash.net.URLRequest;
        import flash.net.DatagramSocket;
        import flash.net.DatagramSocketDataEvent;
       private static function on_DatagramReceived (evt:DatagramSocketDataEvent) : void
        trace(evt)
    I get an error on the function definition, it says "DatagramSocketDataEvent" was  not a compile type constant.  I imported DatagramSocketDataEvent as a known class, why am I getting this error?

    Actually I figured out the answer. This actually demonstrates a bug in the Flash Compiler; I was importing flash.net.DatagramSocketDataEvent, but this symbol is actually found in flash.events.... so why the compiler didn't warn me that flash.net.xxx didn't exist is a mystery, seems obvious to me that an imported symbol better exist else it is a typo.
    so problem solved but it seems like Adobe needs to improve their compiler.

  • [solved] cpanp wrongly complains about missing ExtUtils::MakeMaker

    (This appears to be the most suited subforum for the following matter. Please excuse and correct me if I am wrong.)
    As there is no AUR package for the CPAN module Image::Magick, which I need, I am trying to install it with cpanplus and cpanplus-dist-arch (and yes, I ran setupdistarch). Unsuccessfully, though:
    $ sudo cpanp i Image::Magick
    Installing Image::Magick (6.72)
    Running [/usr/bin/perl /usr/bin/core_perl/cpanp-run-perl /root/.cpanplus/5.14.2/build/PerlMagick-6.72/Makefile.PL INSTALLDIRS=site]...
    Writing Makefile for Image::Magick
    Writing MYMETA.yml and MYMETA.json
    [MSG] Module 'Image::Magick' depends on 'ExtUtils::MakeMaker', may need to build a 'CPANPLUS::Dist::Arch' package for it as well
    [ERROR] Use of uninitialized value $pkgver in substitution (s///) at /usr/share/perl5/vendor_perl/CPANPLUS/Dist/Arch.pm line 1591.
    So cpanp complains about ExtUtils::MakeMaker not being installed, which is wrong:
    $ pacman -Qs makemaker
    local/perl 5.14.2-2 (base)
    A highly capable, feature-rich programming language
    local/perl-extutils-makemaker 6.59-1
    Create a module Makefile
    Re-installing ExtUtils-MakeMaker with cpanp does not help. Any ideas what could be wrong and how to fix it? (Also I am open to suggestions for other means of installing CPAN modules.)
    EDIT:
    Just retried with latest git version of cpanplus-dist-arch. No change.
    Last edited by Franek (2011-10-23 21:16:06)

    Long story short is that Image::Magick is bundled with ImageMagick! Install the imagemagick package and you should be just fine. The PerlMagick distribution which contains the Image::Magick module on CPAN is simply a copy of what comes with ImageMagick.
    The warning about ExtUtils::MakeMaker is just something that cpanp does for every dependency of a module that you build. It is very annoying and other than convincing the CPANPLUS maintainer to remove it, there is nothing I can do about it. But it is a warning and not an error. I've just gotten used to it I suppose.
    The error about an uninitialized value which stops things for you is a bug. I'll try to figure out why it happens and fix it. Thanks for reporting it. I am having a tough time reproducing it, though. Which version of pacman are you using?

  • Keynote complains of missing fonts not in presentation

    Keynote complains about two missing fonts when I open a file, even though I have gone through the deck and changed all of the text elements to a known font.
    I checked the .apxl file in the package, and it's making references to these missing fonts in paragraph styles that are not being used in the presentation. Is there a way to remove the missing fonts short of redoing the deck from scratch?

    Same problem as previous poster but...
    1. I have no idea what an apxl file is; a search of that extension yields zip. Where do I find this file and how do I modify it safely?
    2. I don't want to replace the missing fonts as they are not used anywhere I can find (and I went through every page); rather, I want any reference to them to go away. How do I do that?
    3. I am unable to export the show as a QuickTime file because, "There is a problem with the file," according to Keynote. Could the (erroneous) missing fonts be the problem?

  • JDeveloper 10g does not export .ear, it complains about a JSP

    There is a project on J2EE.
    JDeveloper 10g rejects to export .ear, .war и .jar (EJB jar), it complains about a JSP page, it writes the follwing:
    Error(3,48): FIXED type Attribute value not equal to the default value 'http://java.sun.com/xml/ns/j2ee'.
    Error(4,14): Attribute 'xmlns:xsi' used but not declared.
    Error(5,23): Attribute 'xsi:schemaLocation' used but not declared.
    Error(6,12): Attribute 'version' used but not declared.
    Error(8,15): Invalid element 'description' in content of 'taglib', expected elements '[tlibversion]'.
    Error(8,15): Element 'description' used but not declared.
    That is it complains about descriptors, but I the descriptors must be OK.
    How can I get it working to export .war and .ear successfully?
    May be I should switch off some checks?

    There is a project on J2EE.
    JDeveloper 10g rejects to export .ear, .war и .jar (EJB jar), it complains about a JSP page, it writes the follwing:
    Error(3,48): FIXED type Attribute value not equal to the default value 'http://java.sun.com/xml/ns/j2ee'.
    Error(4,14): Attribute 'xmlns:xsi' used but not declared.
    Error(5,23): Attribute 'xsi:schemaLocation' used but not declared.
    Error(6,12): Attribute 'version' used but not declared.
    Error(8,15): Invalid element 'description' in content of 'taglib', expected elements '[tlibversion]'.
    Error(8,15): Element 'description' used but not declared.
    That is it complains about descriptors, but I the descriptors must be OK.
    How can I get it working to export .war and .ear successfully?
    May be I should switch off some checks?

  • Neither Lightroom 5 nor 6 (just downloaded) will import SRW files.  Complains about an "unsupported color mode."  JPEGs come in fine, but not these RAW files.  Help!

    Neither Lightroom 5 nor 6 (just downloaded) will import SRW files.  Complains about an "unsupported color mode."  JPEGs come in fine, but not these RAW files.  How do I process these images?  What do I need to change on my camera?

    Here's what I've found so far:  Lightroom 6 will support my camera, Samsung NX500, if using "Camera Raw plug-in version 9.0".  Reference is Camera Raw plug-in | Supported cameras.  The Camera Raw 9.0 file is found at Camera Raw plug-in installer.  Haven't got it to work yet, but hopeful...

  • Not many people complain about Verizon's site or is it only I that has problems?

    Almost every single thing that can be done in verizon's site returns an error and suggests calling instead.  Not many people seem to complain about it here though, so it's either me the only one having problems or that people don't care?. When things worked 1 or 2 years ago it used to be great not having to call to change small things; I don't like contacting customer service by phone.

    Things are always changing in the world of computers.  In addition to the mishmash of companies/systems, think of how many computers they must be using to do all those things and in so many different states.
    There are several threads located elsewhere on the forums talking about issues.  Some people have been successfull calling the ECenter number.   Search ECenter 877 and you should find one of those threads.

  • Apple company. Most of iPhone 4g phone users complain about the OS7. Set as a survey of users of iPhones 4g to roll back the OS 6.1.3. Apparatus doesn't work as has to work. Constant lags am feeling it is not iPhone. It is Android or is worse than

    Apple company . Most of iPhone 4g phone users complain about the OS7. Set as a survey of users of iPhones 4g to roll back the OS 6.1.3. Apparatus doesn't work as has to work. Constant lags am feeling it is not iPhone. It is Android or is worse than the Chinese phone.

    Apparatus doesn't work as has to work.Constant lags am feeling it is not iPhone.It is Android or is worse than the Chinese phone. Phone simply brakes... to it чото doesn't suffice

  • Love the iPhone, who to complain about activation illegal practices?

    Dear Folks,
    I got my iPhone, failed the credit check and went with PrePaid. AT&T/iTunes presented me with a page telling my pin/phone # and where to go to fund it. It also had a FAQ saying that my iPhone is fully functional except for the phone part until I fund it.
    It's completely locked and Apple sent me an email reminder to fund my account. I am very angry with these business practices.
    All I'm looking for is an email to complain about this issue to. This is misleading and illegal.

    "Use the form below to send us your comments. We read all feedback carefully, but please note that we cannot respond to the comments you submit."
    I want to reach a human being who's going to either fix the issue or issue me an apology.

  • Please help suggestions for solving built-only compiler error: 'The VI is not executable. The full development version of LabView is required tofix this error.'

    We have develoepd a software tool and build it on regular basis. It currently runs error free when compiled in the editor, but when we built it and run the executable stand alone we get the error.
    'The VI is not executable. The full development version of LabView is required tofix this error.' plus a broeken error.
    This menas an compiler error that is not present in the editor but in the stand alone version. We tried to identify errors as suggested in several posts in this forum, but so far unsuccesfull.
    As the editor and its compiler do not see the error  and are running fine and the stand alone version just syas 'find the error in the editor' in this case LabView is of no help.
    Can anyone suggest a sensible or 'good practice ' way of searching for the source of this error?
    Our project  comprises hundreds of Vis over several libraries.
    Thanks,
    Chris

    Thanks Craig for all your suggestions.
    We seem to have located the problem in a new vi just added to the package causing conflicts by using the same vi names as other vis already present in the package. Excluding this vi removed the error.
    It seems related to a conflict by having two vis with the same name, which was mentioned by LabView and interactively resolved when running the main vi from the editor. When successfully building the main vi the builder did not mention this conflict and reported a successful build, but when trying to run the executable it gave the cryptic error. The error caused us problems because there was no hint for the cause, just the suggestion to solve this in the editor, while at the same time in the editor the VI was running fine.
    We will post about this in detail after we have positively proven that this actually was the case.
    The .net version issue was already checked.
    Performance was the same on all machines we tested on including the dev machine.
    Debugging was tried nut did not help as the vi could not run (broken arrow). We assumed that debugging only helps in running faulty functioning vi''s. We did not check for broken arrows in sub-vis (after connecting), that could have helped, although our application has hundreds of our own vis.
    In relation to your remark: 
    'Are you using many classes? Have you verified that the proper access scopes are set for functions calling those vis?'
    Could you elaborate on setting access scopes. We were not aware of this option in LabView, although we realize this is a basic element of the underlying c code.
    Ragrds,
    Chris

  • HOW TO COMPLAIN ABOUT NOKIA 6230i

    Hi Nokia Users
    I would like to request that more people with 6230i handsets complain to nokia either by phone or email.
    The reason i am asking everyone this is that it seems whatever is posted here in discussions doesnt get any attention from nokia.
    I and many others have complained about this handset for months and nothing has happend not even an NSU response.
    Nokia seem to focus more on newer handsets and forget about the majority of the true honest customer.
    This handset should be seen as priority immediately over and above all other handset right now regardless of what anyone else thinks.
    So email nokia or phone get as many complaints as possible.
    Madmick

    just to make it clear to everyone the 6230i was released in 2005 not 2002 .
    the mobile everyone is getting mixed up with is the common old 6230 note no (i) at the end.
    even though this mobile is nearly two years old it should still have full support remember you and everyone else who has a nokia handset wouldnt like it if support for it was cut off after just six months..
    so dont expect me to accept the lack of support as i have stated many times before.
    read as many of my posts as you can before making any statement or posting any answer to me.
    just a small breakdown of the issues
    the 6230i has over 30 known faults with firmware older than 03.80 or 03.88.
    the present released firmware is definately 04.22 not 03.88 and that is directly from nokia and a number of friends worldwide who work in the mobile phone industry including and especially Nokia...
    so to put it politely i should have a free firmware for my handset like everyone else as i have no warranty and i am definately not paying any more money for my £200 handset that has already cost me an extra £150 since purchase .
    so please do not write back and say take it to a service centre as they are the main problem..

  • Constructor Not Properly Recognized

    Alright, I'm building a scorekeeping program for a pool game some friends and I play. I had it working for only two players, however a friend suggested that it would be better if we could have n players, so I replaced the two Player objects with an array of them, so I've spent the past hour or so getting everything compatible with the array. However, when I changed the constructor for my GUI, it is no longer working. I'm getting a compile error, and I'm not sure why. If anyone could help, I'd really appreciate it.
    Constructor:
    public NinetyThreeGUI(int numPlayers, Player[] players, Player active)
                   //stuff
    {code}
    Call:
    {code:java}
    NinetyThreeGUI(Driver.numPlayers, Driver.players, Driver.players[startInput.getText()]);
    {code}
    And the error I'm getting:
    {code:java}
    cannot find symbol method NinetyThreeGUI(int,Player[],Player)
    {code}
    Any help will be greatly appreciated!  Thanks in advance!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    You need to use new with the constructor name.
    Unless you're already inside a c'tor and you want to invoke another c'tor of the current class or the superclass, then you use this(...) or super(...)
    Foo foo = new Foo(...);
    class Foo {
      Foo() {
        this(...); // to invoke another Foo c'tor
        // or
        super(...); // to invoke a superclass c'tor
      Foo(...) {
    }

  • Superclass Constructor calling overridable validation method

    I have the following class:
    public class SuperClass
       private int x;
       public SuperClass(int x)
          setX(x);
       protected void validateX(int x)
          if(x < 0)
             throw new IllegalArgumentException("x < 0");
       public int getX()
          return x;
       public void setX(int x)
          validateX(x);
          this.x = x;
    }My question is: How can I avoid calling setX(int) in the constructor besides simply dupicating validateX(int) in the constructor if I want to subclass SuperClass? [I read in a recent Java Fundamentals newsletter that calling overridable methods in superclass constructors is a bad idea int that it tends to destabilize the whole class hierarchy.  I don't want to make validateX(int) and setX(int) final.]

    Never call overrideable methods from constructors. No exceptions.
    You can use a factory method to validate your object after its created if you must.
    public class SuperClass
       private int x;
       public SuperClass()
       static SuperClass createSuperClass(int x){
             SuperClass sc = new SuperClass();
             sc.setX(x);
             return sc;
       protected void validateX(int x)
          if(x < 0)
             throw new IllegalArgumentException("x < 0");
       public int getX()
          return x;
       public void setX(int x)
          validateX(x);
          this.x = x;
    }Or you can use template method
    public class SuperClass
    private int x;
    public SuperClass(int x)
    setXImpl(x);
    final protected void validateX(int x)
    if(x < 0)
    throw new IllegalArgumentException("x < 0");
    public int getX()
    return x;
    final void setXImpl(int x){
    validateX(x);
    this.x = x;
    public void setX(int x)
    setXImpl(x);
    In general I don't like to call any overrideable methods from within my class. I try not to be anal about it though. My personal choice would be to duplicate the set method in the constructor. You should be constructing the object not using it. access instance variables not methods.

  • Why are Constructor not inherited?

    Hello,
    how come Java Constructors are not inherited by subclasses? Consider:
    ClassA
    ClassA(someParameters)
    ClassB extends ClassA
    How come do I need to declare a Constructor in ClassB that will accept "someParameters"? Why don't my ClassB simply inherites its parent Constructor?
    Thanks for any insights :-)
    PA.

    Hi,
    Straight from the Java Language Specs:
    2.12 Constructors
    A constructor is used in the creation of an object that is an instance of a class. The constructor declaration looks like a method declaration that has no result type. Constructors are invoked by class instance creation expressions, by the conversions and concatenations caused by the string concatenation operator +, and by explicit constructor invocations from other constructors; they are never invoked by method invocation expressions.
    Constructor declarations are not members. They are never inherited and therefore are not subject to hiding or overriding.
    If a constructor body does not begin with an explicit constructor invocation and the constructor being declared is not part of the primordial class Object, then the constructor body is implicitly assumed by the compiler to begin with a superclass constructor invocation "super();", an invocation of the constructor of the direct superclass that takes no arguments.
    If a class declares no constructors then a default constructor, which takes no arguments, is automatically provided. If the class being declared is Object, then the default constructor has an empty body. Otherwise, the default constructor takes no arguments and simply invokes the superclass constructor with no arguments. If the class is declared public, then the default constructor is implicitly given the access modifier public. Otherwise, the default constructor has the default access implied by no access modifier.
    A class can be designed to prevent code outside the class declaration from creating instances of the class by declaring at least one constructor, in order to prevent the creation of an implicit constructor, and declaring all constructors to be private.
    This should answer your question and then some.
    Try reading the JLS yourself to get answers as to why ... then come back here and get help with how.
    http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html
    Regards,
    Manfred.

  • New 3510s not presenting LUNs correctly.

    Whoops! I originally posted this on the Other Sun Hardware forum, but this is definitely the more appropriate place.
    I just attached four new 3510s to a server that already has a 3510 attached. They each have their own connection to the server, so there is no daisy-chaining going on. The server sees the old 3510 as a 3510 with each LUN properly presented as 3510s of the correct sizes.
    The new 3510s, however, are not identifying themselves as 3510s, nor are they presenting the logical disks in their correct sizes. Instead each LUN (consisting of no less than 2-disk, RAID 0s) is showing up like single, 146GB drives! They're not even displaying StorEdge3510 in the disk type when I run format! It's as though the new 3510s are presenting themselves as JBODs (of incorrect sizes, no less) instead of 3510s with controllers!
    The new 3510s were upgraded to the latest firmware (4.15G) before any RAIDs were created and given four logical disks, each in a RAID 0 configuration, made of 2 disks (~290 GB), 3 disks (~435 GB), 3 disks (~435 GB), and 4 disks (~580 GB). This is different from our original 3510 which has all of the disks in a RAID 5 with two partitions. (The original 3510 is running firmware 4.13C.)
    When I run format, the server sees each of the 16 LUNs. (I verified this by taking some LUNs offline, which then showed up in format as "disk format undetermined" or something like that.) So, the server definitely sees the LUNs, but the 3510 is not showing them in their correct size nor is the disk name reflecting that it's a 3510. That tells me that the 3510 is not presenting itself properly, but it responds without a problem to sccli and appears to be configured properly.
    I tried creating a logical partition inside one of the 2-disk, logical disks and presented that as a LUN. No dice. It still showed up as a non-3510, 146GB disk. I tired making a logical volume and presented that. Same thing -- a non-3510, 146GB disk was presented.
    With the exception of the different firmware versions and using RAID 0 instead of RAID 5, I can't see any difference between the configuration between the two 3510s. Any ideas what I could be missing with the new ones? Could firmware 4.15G be bad? I really would like to get this resolved by this weekend.

    It's what would normally be in a JBOD - what would be the equivalent of FC2 and FC3. In fact, I took it out as a test at which point the 3510 complained about losing temperature and redundancy modules! So, it's not ignoring the JBOD controller.
    But It gets better! I rebuit one of those 3-disk, RAID 0 logical drives as RAID 5. Not only is the 3510 building that RAID 5 now, but look at how format is presenting the LUNs now!
         464. c12t40d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
              /ssm@0,0/pci@19,600000/SUNW,qlc@1/fp@0,0/ssd@w216000c0ff87d116,0
         465. c12t40d1 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
              /ssm@0,0/pci@19,600000/SUNW,qlc@1/fp@0,0/ssd@w216000c0ff87d116,1
         466. c12t40d2 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
              /ssm@0,0/pci@19,600000/SUNW,qlc@1/fp@0,0/ssd@w216000c0ff87d116,2
         467. c12t40d3 <SUN-StorEdge3510-415G cyl 35073 alt 2 hd 64 sec 255>
              /ssm@0,0/pci@19,600000/SUNW,qlc@1/fp@0,0/ssd@w216000c0ff87d116,3
    partition> print
    Current partition table (default):
    Total disk cylinders available: 35073 + 2 (reserved cylinders)
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm       0 -    16      135.47MB    (17/0/0)       277440
      1       swap    wu      17 -    33      135.47MB    (17/0/0)       277440
      2     backup    wu       0 - 35072      272.94GB    (35073/0/0) 572391360
      3 unassigned    wm       0                0         (0/0/0)             0
      4 unassigned    wm       0                0         (0/0/0)             0
      5 unassigned    wm       0                0         (0/0/0)             0
      6        usr    wm      34 - 35072      272.67GB    (35039/0/0) 571836480
      7 unassigned    wm       0                0         (0/0/0)             0The RAID 5 is now identifying itself as a 3510 disk of 272 GB, which is correct for a 3-disk RAID 5!!
    And according to the 3510 Best Practices manual on page 23, having the JBOD panel in the other slot appears to be acceptable even if there is nothing attached to it.
    But considering how differently the 3510 is treating the RAID 5 compared to the RAID 0, something is defintely not right here.

Maybe you are looking for

  • Why are there two versions of Adobe Acrobat XI Pro in my Programs

    I understand the annoyance and confusing issues with CC and CC 2014 programs.  I also have read in the community of Acrobat installing twice purposely? My question is all my CC (or CC 2013) programs installed around early Feb.  The newer CC 2014 prog

  • Unable to get Adobe Reader to open.

    I am unable to get Adobe Reader to open. I am on Windows XP, SP3 and I have tried with Adobe Reader 9, 10, and 11. When I try opening a PDF file, if I look in the Task Manager, the AcroRd32.exe process will appear, however nothing shows up under the

  • How do I find out if my iphone is locked to a network or not?

    I have an iphone 5 which is on 3network, I need to find out if it is locked to that network or not, I would like it to be opened up to any network as I am going abroad next month and would like to put a local SIM card in while I am away

  • Does weblogic server include an LDAP server

    We have Weblogic 5.1 app server in house and people are looking into LDAP servers. Does weblogic include an LDAP server? Is one available via an add on? If so what is the cost? Thanks, Bill

  • Traveling  with your iPhone...

    I'm traveling for the 1st time with my iPhone in a few weeks and was wondering if it is OK to put it under the airport security xray scanners. Has anyone had this experience? Will it "hurt" my iPhone?