Brian
  • Member for 10 years, 11 months
  • Last seen more than a month ago
  • MN, United States
Equals and hashCode implementation
3 votes

What exactly is the id variable? int? long? Integer? Your hashCode and equals implementations really just "pass the buck" to the id. That being said, the code you posted will work fine; two ...

View answer
WCF service and database
2 votes

You have a lot of "magic if blocks": if (instance == null) instance = new DBWorker(); Best practice is to always enclose if-then statements in braces: if (instance == null) { instance = new ...

View answer
Visualization of the Traveling Salesmen Problem
2 votes

You might change from ArrayList to HashMap. That will give you better performance for large numbers of cities (for small numbers of cities, the overhead of using a HashMap can be more than what you ...

View answer