This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Class declarations inside methods  RSS feed

 
Bod McLeon
Ranch Hand
Posts: 65
Eclipse IDE IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone here list (using the line numbers at the side) where i have put class declarations inside methods.
I was told that I had put class declarations inside methods in an earlier post.
Here is my code so hopefully you can figure something out.



Kind regards -
The newbie Bod 

 
Stephan van Hulst
Saloon Keeper
Posts: 7805
142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have class pokemon (remember that class names should start with a capital letter) at line 92, inside method playGame() at line 39.
 
Bod McLeon
Ranch Hand
Posts: 65
Eclipse IDE IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:You have class pokemon (remember that class names should start with a capital letter) at line 92, inside method playGame() at line 39.

Is there any where else because WELCOME TO POKEMON,     GO....,      THE ENEMY FAINTED +      YOU FAINTED. These are all getting the error 'Class' or 'Interface' expected and again I was told it might be because of Class declarations inside methods.
 
Norm Radder
Ranch Foreman
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you copy the full text of the compiler error messages and paste them here so we can see what you are talking about?
 
Dave Tolls
Rancher
Posts: 2913
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thos errors are almost certainly down to a mismatch of brackets.

Your current indentation makes it difficult to see which brackets match with which.
I suggest a round of tidying up.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!