• Post Reply Bookmark Topic Watch Topic
  • New Topic

String array Declaration and initialization  RSS feed

 
Anu satya
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I am trying to declare a string array and initialize it with some values. But, while doing so, I am getting error as "Syntax error on token ";" { expected after this token"
I am not understanding where i am going wrong. Please help me.


Please help
 
Willie Tsang
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
remove public.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Willie Tsang wrote:remove public.


No, that's not relevant.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anu satya wrote:HI,
I am trying to declare a string array and initialize it with some values. But, while doing so, I am getting error as "Syntax error on token ";" { expected after this token"
I am not understanding where i am going wrong. Please help me.


No, that code is perfectly legal if you take out your note about the error.
 
Subhash Pavuskar
Ranch Hand
Posts: 57
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://techno-cratic.blogspot.in/2008/11/many-public-classes-in-1-java-file.html

Put your complete code so that we can solve your problem easily.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Subhash Pavuskar wrote:http://techno-cratic.blogspot.in/2008/11/many-public-classes-in-1-java-file.html . . . .
There is at least one serious error in that link. I’d ignore it if I were you.

It would be more useful to see the error messages. How did you attempt to compile that class? As Jeff has already said, there are no errors in what you posted.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Subhash Pavuskar wrote:
Put your complete code so that we can solve your problem easily.


Please note that we're not here to solve his problem for him. We're here to give him the tools to solve it himself and to point him in the right direction.
 
Umang Bhatt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please post complete code
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umang Bhatt, welcome to the Ranch
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!