Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Have some methods to set up for some Java HW that I'm having trouble with.  RSS feed

 
zac woot
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was given this interface to implement.




So far have made




Also made a driver class which makes a Set and adds 3 elements to it and prints them. I'm having trouble with remove and contains methods. I'm also supposed to have an override equals to method and toString method, and I've already done the toString one.
 
Liutauras Vilda
Sheriff
Posts: 4917
334
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Have a look at > HowToAskQuestionsOnJavaRanch, you might find this useful.

zac woot wrote:I'm having trouble with remove and contains methods.


Please be more precise what kind of troubles you facing?

And is worth to check how properly UseCodeTags
 
Knute Snortum
Sheriff
Posts: 4274
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've put in the code tags for you this time.

There's nothing illegal about a double being negative.
 
zac woot
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thanks for the replies I see what I did wrong with the code text. Thanks for the comment on the doubles being negative, we were instructed to not allow negatives in the list for some reason and I just auto pilot typed that ha.

Solved all the methods just now. I'm not as rusty as I thought I was apparently.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!