• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 9012
655
Mac OS X Spring VI Editor BSD Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 7126
185
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic