Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22
Like Tree3Likes

Thread: Class troubble

  1. #21
    DiamondSoul is offline Member
    Join Date
    Oct 2011
    Rep Power

    Default Re: Class troubble

    No, but it would be simpler, rather than doing all this stuff with Strings to determine if blood can be given, to simply put two accessor methods in the Blod class, one of which returns A, and the other of which returns B. Then, in the kanGiBlodTil(), do your logic with booleans instead of Strings. The code would be shorter, more readable, and more efficient.

  2. #22
    Juukamen is offline Member
    Join Date
    Oct 2011
    Rep Power

    Default Re: Class troubble

    Quote Originally Posted by Fubarable View Post
    Again, please undelete your deleted post above. This thread is not just for you but for all who search this information in the future, and our replies don't make sense without this post.
    it's the same as #19 but i thought there was somethign wrong with my code. it seems like i was missing something and it was "AB" && "AB" comparion in the "Blod" class. as you cans ee in the java code line 24 and 25. but the only diffrence from my deleted post and this, is those lines. and it's working good.

    yep, agree. but the client program "Blodgivingstest" was pre written and they wanted to use the person class for those.
    Last edited by Juukamen; 10-27-2011 at 07:36 PM. Reason: reoy to DiamondSoul

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 0
    Last Post: 03-27-2011, 06:49 AM
  2. Replies: 5
    Last Post: 01-26-2011, 07:38 PM
  3. Replies: 8
    Last Post: 04-14-2010, 06:49 AM
  4. Replies: 7
    Last Post: 05-06-2009, 01:42 PM
  5. Replies: 8
    Last Post: 03-21-2009, 10:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts