Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

String array Declaration and initialization

 
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
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
remove public.
 
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.
 
Ranch Hand
Posts: 57
Eclipse IDE Chrome 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.
 
Marshal
Posts: 70370
283
  • 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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please post complete code
 
Campbell Ritchie
Marshal
Posts: 70370
283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umang Bhatt, welcome to the Ranch
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic