Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HashSet

 
Jayaram Subramanian
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The code is not compiling and giving identifier expected. Where am i going wrong?
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The last few statements seems to be floating around. Try putting them in to the main method.

It would also help if you posted the error output..
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are few errors in your code.
First the part,



should be inside a normal method or in the main method (not everything in that but as you trying to test your class it's better be in the main method).

Constructor for the SetTest(String) is not defined. Instead you have,


which is considered a normal method, happen to have the class name. It should be


And,


is wrong, since you can't add String to a set which is defined to have objects of SetTest.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic