• Post Reply Bookmark Topic Watch Topic
  • New Topic

hitting some brick walls  RSS feed

 
Yedwana Mandlayafutha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys
I very new to Java and I am trying some codes, I seem to be hitting some brick walls can some help by correcting the following for me.



Your help will be appreciated guys. I kind of enjoy this thing but I'm such a novice such that I get so confused that leads me to lose my way forward. I will send the other parts to this after getting corrections with this one.
Thanks
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch. What kind of corrections are you looking for? What does this code do now, what should it be doing instead, and were are you stuck making the required changes?
 
Yedwana Mandlayafutha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer
In general, this code should perform the steps as shown, for example, where it says it should list (by printing) all members entered(registered) in library. When I try to print it brings back the following:
Member Details: Name:- [Member@fe464e]:ID # 55

By the way I am writing the code in BlueJ which is Java. In general, may ask that you check all of it for me. Although I have kind of written it, some of those functions do not bring the expected outcome. If you can test it using the BlueJ, it may help
I know I am not really clear, but as a novice, that is what I can say really.
Please help. Thanks
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sima Moyo wrote:Hi Ulf Dittmer
In general, this code should perform the steps as shown, for example, where it says it should list (by printing) all members entered(registered) in library. When I try to print it brings back the following:
Member Details: Name:- [Member@fe464e]:ID # 55



In that line you are printing the whole members ArrayList. Surely you just want to print the member with the supplied memberId from the members ArrayList you should be looking for the member with that id first and only printing that one not the whole list.
Also, use code tags when posting code next time.
 
Campbell Ritchie
Marshal
Posts: 56587
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
E Armitage wrote: . . . Also, use code tags when posting code next time.
Ulf has kindly added code tags, and they make your post look a lot bettr. Unfortunately they highlight the long lines, so I broke them for you, and you can see how it should be done. Avoid // comments more than 1 line long. Use /*…*/ comments instead.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yedwana Mandlayafutha wrote:In general, this code should perform the steps as shown, for example, where it says it should list (by printing) all members entered(registered) in library. When I try to print it brings back the following:
Member Details: Name:- [Member@fe464e]:ID # 55

So that's the problem. You're getting an error.

By the way I am writing the code in BlueJ which is Java. In general, may ask that you check all of it for me. Although I have kind of written it, some of those functions do not bring the expected outcome.

Did you write it yourself, or are you just (as you said in your OP) "trying" it? It would appear, at least on the surface, to be reasonably well written, so I'm surprised that you would be wondering what the error is.

If you can test it using the BlueJ, it may help...

No, that's your business.

And BlueJ shouldn't make any difference. Java is Java.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!