Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

also need help this code  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


main class
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bob. Welcome to the Ranch! You need to actually ask a question if you want us to help you effectively, though. What specifically do you need help with?
 
lowercase baba
Bartender
Posts: 12627
50
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
at the very least, it looks like your inputAnimals method isn't closed...I think someone got a little trigger happy when commenting out stuff. The brace on line 35 needs to be uncommented (I think).
 
Marshal
Posts: 60083
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you are dealing with too much code all at once. you should write, maybe, five lines only before compiling and running whatever code you have. That way you find errors much more quickly.
You should also, I think, write write some of your } backwards. As you will see from the link, “backwards” means you write lines in a different order from what you usually do.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12627
50
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:You should write, maybe, five lines only before compiling and running whatever code you have.


FIVE? IMHO, that is still way too many. I never go more than 2-3.
 
Campbell Ritchie
Marshal
Posts: 60083
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That’s six lines, and still does nothing much.

You have four lines each containing only { or }, so you ain’t going to get very far with three lines

But Fred and I agree that you must write little bits of code and make sure they work before going on to the next bit.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12627
50
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm....maybe I don't really count "lines" of code. i would consider this to be one:

since technically, it can be written on one line:

and yes, so could your original six lines:

but that's just silly.

I guess I don't count braces as 'lines of code' since they can be written in so many different ways.
 
Campbell Ritchie
Marshal
Posts: 60083
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think your line arithmetic and mine will result in our both writing the same amount of code at a time
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!