Search:

Type: Posts; User: aussiemcgr

Search: Search took 0.17 seconds.

  1. Re: Having trouble understanding object relationships and using them correctly?

    The "normal" way to compare two objects in java is to either:
    1. override the .equals() method, in your Account class, that is inherited from the Object class
    2. Implement the Comparable Interface...
  2. Re: Having trouble understanding object relationships and using them correctly?

    Your problem is with comparing Strings:
    if(account == "joe")
    String are objects, therefore when you are comparing for equivalency, you need to use the .equals() method instead of ==...
Results 1 to 2 of 2