Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help on " missing method body, or declare abstract"  RSS feed

 
Jack McGonnell
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!