Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Help on " missing method body, or declare abstract"

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I looked it up on a bazillion different websites and I couldn't see anything wrong with my brackets or not including my sub-classes in my big class.
the code:

Errors:
onehundred.java:9: error: missing method body, or declare abstractpublic static String request(String gotourl, String urlParameters); ^onehundred.java:14: error: cannot find symbol URL url = new URL(gotourl); ^ symbol: variable gotourl location: class onehundredonehundred.java:24: error: cannot find symbol wr.writeBytes(urlParameters); ^ symbol: variable urlParameters location: class onehundredonehundred.java:37: error: return outside method return response.toString(); ^onehundred.java:40: error: return outside method return null; ^5 errors
 
author
Posts: 23919
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jack McGonnell wrote:Yes, I looked it up on a bazillion different websites and I couldn't see anything wrong with my brackets or not including my sub-classes in my big class.



It is not related to the brackets. You have an extra semi-colon after the method declaration on line 9. This is why the method body is missing. As for the code after the semi-colon, that becomes part of an instance initializer (along with some issues).

Henry
 
I was her plaything! And so was this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic