• Post Reply Bookmark Topic Watch Topic
  • New Topic

I keep getting this error and dont know what to do to fix it?  RSS feed

 
Cassandra Rodriguez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone, I am very new to java and programing (which is why i am taking a class) but i dont understand why i keep getting this same error. please let me know what you could tell me to fix this. THANKS! See below:
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.
In future, while posting code, please UseCodeTags I have added them to your post this time. As you can see, it makes the code much more easier to read and understand.



What the error is telling you, is that your method should return an int value. Something like return 42; More on method return types here http://download.oracle.com/javase/tutorial/java/javaOO/returnvalue.html
However, I think you meant it as a constructor instead of a method. If yes, the form should be changed to
 
Cassandra Rodriguez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Maneesh Godbole
I have tried this and the error is "return type for the method is missing". What should i do now?
 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cassandra,

You have a mismatch between the class name and the constructor name. The constructor name needs to match the class name. Fixing that, and removing the return type, should solve your problem.

John.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!