Kevin O'Sullivan

Ranch Hand
+ Follow
since May 16, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
42
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kevin O'Sullivan

Haven't had a chance to try the above yet but Thanks everyone for all yer help, I ordered the effective java book, can't wait to give it a read, seems to be a popular book.
14 hours ago
Thanks a lot for your help, I ordered the effective java book, can't wait to give it a read, seems to be a popular book.
14 hours ago

Campbell Ritchie wrote:Where did you read about hashCode() and equals()? What did they say? I worry about randomly‑found online tutorials; most of them are poor quality.
I recommend you find Effective Java by Joshua Bloch (old edition here),  Odersky Sppon and Venners, and search for Angelika Langer Java equals() hashCode(). Make sure to get the English edition of Langer.

Kindly don't delete your questions, neither here nor on the other forum.




Here

Just they are used to compare objects and return true or false but I don't have any clue how to implement it for what I need to do.

Tutorial

and this video


2 days ago
I've been reading up and watching videos on hashcode and equals method as I know nothing about them and I am having trouble understanding how to implement them, am I right in saying these methods should be in the book class ?
2 days ago

Carey Brown wrote:

Kevin O'Sullivan wrote:yup did this as well but still have the same problem, not deleting any hardcoded books.

Kevin, when you make a change and then say "nope, it doesn't work" we can't help you unless you show us all the code again.



Sorry about that carey, I'll give that a go and report back.
4 days ago

Paul Clapham wrote:

Kevin O'Sullivan wrote:

Paul Clapham wrote:Are you referring to the inputBookToDelete() method, which creates a new (presumably empty) library and then tries to delete books from it?



Yup well that method takes the input and then the method in Library class deleteBooks() is suppose to take care of the deleting .



Like Carey said. Just create one Library. And it should have only one list of books (i.e. making that a static variable is wrong).




yup did this as well but still have the same problem, not deleting any hardcoded books.
4 days ago

Carey Brown wrote:Your problem is that you are creating new libraries all over the place. In your entire project you should only be creating one new Library to represent the Cork Library. You have also made most of your fields public which is allowing inputs of new books a back door into a library from which delete succeeds.



ok  I made one instance of library class but had to declare it I've a feeling this isn't good practice lol.
4 days ago

Paul Clapham wrote:Are you referring to the inputBookToDelete() method, which creates a new (presumably empty) library and then tries to delete books from it?



Yup well that method takes the input and then the method in Library class deleteBooks() is suppose to take care of the deleting .
4 days ago
The delete function in my library program doesn't work properly, it won't delete the hard coded in the list but if I enter them in via user input it does, why is this?









Any help appreciated.
4 days ago

Carey Brown wrote:Can you give me an example of what you're thinking with the methods stubbed out?



Heres the example carey

1 month ago

Campbell Ritchie wrote:Who said utility classes had private methods. All the utility classes I can remember seeing have public static methods.




Ohhh my mistake I could have sworn I read somewhere they were private.
1 month ago
I just had a thought, if all the methods in a utility class are suppose to be private, how do you access them from outside the class?
1 month ago
Would also like to see the source code if possible please.
2 months ago