• Post Reply Bookmark Topic Watch Topic
  • New Topic

Basic compiling problem  RSS feed

 
Chitra anjali
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


What is wrong with this code? why is it not compiling?Also, it is supposed print 12 , how can I get that output, please edit and help.Thank you!

This is one of the error messages showing at line public static void go(final int x) !

Multiple markers at this line
- Syntax error on token "(", ;
expected
- Duplicate local variable x
- void is an invalid type for the
variable go
- Syntax error on token ")", ;
expected


 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to CodeRanch!

While posting code, please UseCodeTags. This can be used by selecting the code text and pressing 'code' button.

Also, please TellTheDetails - that is, what is the error you are getting?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the future, please post the error message.

In this case, you are trying to declare a method within another. Not possible.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!