Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java assignment problem

Options
2»

Comments

  • Users Awaiting Email Confirmation Posts: 489 ✭✭AngryDiMaria


    Thee's no need to run an evaluation here. its pointless. borrowed is already declared of type boolean, so there's no need to check if its true or false. Just return it.
     public boolean isBorrowed()
        {
           return borrowed;
        }
    

    Also, method names should be verbs, so using borrowed as a method name is poor convention practice. it should be something more akin to
    public void borrowBook(){}
    
    It would also be a good idea to return something from this method so you could check if the borrow was successful.

    I just patched up the OPs code, the methods and names were not written by me.


  • Registered Users Posts: 778 ✭✭✭pillphil


    Not much help for the assignment, but OP, there is a print screen button you could use instead of taking a photo of your monitor. (Usually in the top left right of the keyboard)

    Or press the windows key, type snip and select the snipping tool. This will let you take part of the screen as an image.

    If you need to show someone a tool tip or something you need to hover over, use the screenshot button first, paste it in paint and then use the snipping tool.

    Edit: balls :o


  • Registered Users Posts: 6,252 ✭✭✭Buford T Justice


    I just patched up the OPs code, the methods and names were not written by me.

    That was more general comments, and not directed at you specifically


Advertisement