Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compilation error...

 
archana keerti
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
please anyone could help me... i got an error message saying array dimension missing in the 12th line...

 
Sridhar Santhanakrishnan
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using
;
instead of


and please use code tags.
 
archana keerti
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i dont get the output even after changing ,


instead of


i get an error saying ,cannot find the symbol.
 
Sridhar Santhanakrishnan
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You get that error usually when you havent declared the variable.


Look at the line of code.

dog[x]=new dog();

You have declared the array as d[] not dog[] change it to d[x] and it should work.

Take some time off to read the error description. Java error messages tend to be pretty exhaustive and clear (mostly).

 
archana keerti
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for clearing my doubt.....i got the output.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic