Tuesday 15 February 2011

java - implicit super constructor object() is undefined. must explicitly invoke another constructor -


Is this a new bug? I got a new Mac computer and the checksum matches exactly but when I try to make a simple class, just for basic testing, I get the error mentioned in the headline I never complained about java Object () Constructor here is the square:

  package com.my.ok; Public class first {}   

Edit:

I think if I type execution environment to javaSE- 1.7

enter image details here

This problem occurs if your JRE project is not configured in the built path. <

  • Build Path - & gt; Select Configure Build Path

  • Go to Library tab Add Library .
  • Select JRE System Library Click Next
  • Then from the option according to your requirement JRE Right click on the project and select end

    Properties / Code>.

  • Select Java platform in the Library category according to your requirement
  • Then go to Source category and select Source / Binary format and select your Choose JDK as per the requirement. The error was because you did not include the system library in your project and your class object () was not able to find the constructor, which is said earlier in the hierarchy when you are creating a thing when you create an object.

    Example:

      package com.my.ok; Public class first {}   

    what happens compiler by default your first class to object class Expands to

      package com.my.ok; The public class extends first object {}   

    but in your case the object class was not found and you are getting this error.

  • No comments:

    Post a Comment