• Post Reply Bookmark Topic Watch Topic
  • New Topic

Loop confusion  RSS feed

 
Landon Simmons
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to cycle through different subscribers and make sure that none of the entries have the same address.
My equals runs but the results vary.



 
Carey Brown
Bartender
Posts: 2998
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if(address == SecondSub.address)
Don't use == to check if objects are equal. Use .equals().
 
Landon Simmons
Greenhorn
Posts: 17
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much I got it working now!
 
Campbell Ritchie
Marshal
Posts: 55761
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for not replying earlier; I have been very busy.
Please format your code so there is more space; you should separate successive methods by empty lines. It makes it much easier to read, and allows you more easily to see where method 1 ends and method 2 begins. While on about where methods start and finish, please tell us where your setRate method (line 33 in your abstract class) starts and finishes.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!