• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Bear Bibeault
  • paul wheaton
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Mikalai Zaikin
  • Piet Souris
Bartenders:

String array Declaration and initialization

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
remove public.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 78438
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please post complete code
 
Campbell Ritchie
Marshal
Posts: 78438
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Umang Bhatt, welcome to the Ranch
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic