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
    Posts
    83
    Rep Power
    0

    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
    Location
    Tromsų
    Posts
    42
    Rep Power
    0

    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.

    @DiamondSoul:
    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 06:36 PM. Reason: reoy to DiamondSoul

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 0
    Last Post: 03-27-2011, 05:49 AM
  2. Replies: 5
    Last Post: 01-26-2011, 06:38 PM
  3. Replies: 8
    Last Post: 04-14-2010, 05:49 AM
  4. Replies: 7
    Last Post: 05-06-2009, 12:42 PM
  5. Replies: 8
    Last Post: 03-21-2009, 09: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
  •