Hello,
I'm new to java and my problem is this:
Qt Code:
  1. class Word {
  2. private String _value;
  3. public Word(String value) { _value = new String(value); }
  4. }
  5.  
  6.  
  7. //main
  8. HashSet< Word > dictionary = new HashSet< Word >();
  9. dictionary.add( new Word( "goodbye" );
  10. dictionary.add( new Word( "hi" );
  11. dictionary.add( new Word( "hello" );
  12.  
  13. if ( dictionary.contains( Word( "hello" ) )) ) { //how to to this?
  14.  
  15. }
To copy to clipboard, switch view to plain text mode 

I need to know if dictionary contains that word. I know it's simple but I can't do it

Any hints, please?