• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

hitting some brick walls

 
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
 
Rancher
Posts: 43011
76
  • 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
 
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.
 
Marshal
Posts: 65407
248
  • 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.
 
Bartender
Posts: 10777
71
Hibernate Eclipse IDE 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
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!