This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes missing method body error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "missing method body error" Watch "missing method body error" New topic
Author

missing method body error

rajesh villuri
Greenhorn

Joined: Apr 06, 2013
Posts: 4
i typed this program in netbeans

in netbeans, i am getting like this error for all programs

please help ,

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - missing method body, or declare abstract
at widget.Widget.<init>(Widget.java:10)
at widget.Widget.main(Widget.java:16)
Java Result: 1
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11257
    
  16

look VERY closely at this line, and let us know if you find something that perhaps shouldn't be there:



There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
And welcome to the Ranch
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
I have added code tags, which you should always use, to your code, hoping it would make it look better (it does) and make the lines numbers visible, but the error Fred pointed out appears not to be on lines 10 and 16, but 6.
rajesh villuri
Greenhorn

Joined: Apr 06, 2013
Posts: 4
thank you ritchie
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
You're welcome
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: missing method body error