Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: an exam question

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default an exam question

    Hi All,
    I need to send the answer of this question quickly and I was wondering if you help me for that.
    -There is a method taken from a class with several try and catch blocks. If you think it is possible, add one more catch block to the code to catch all possible exceptions, otherwise say 'Not possible' with your reason.

    public String getCountyCode(Address inputAddress) throws AddressNormalizationException
    {
    String retval = null;
    try
    {
    retval = this.normalizeAddress(inputAddress).getCountyCode( );
    }
    catch(InvalidAddressException e)
    {
    retval = INVALID_COUNTY_CODE;
    }
    catch(AmbiguousAddressException e)
    {
    retval = INVALID_COUNTY-CODE;
    }
    return retval;
    }

    ThankYou!


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: an exam question

    We won't do your exam for you, and we probably sent that message by not responding as quickly as you needed. If you intend to hang around, please read this topic to learn how to post code correctly along with other useful info for newcomers.

    Hints: Avoid using topic titles like, "Exam Question," "Help with Test/Homework," or "Urgent Help Needed." Those get a laugh and are often passed by. Instead, present the problem as generically as you can and OFFER YOUR ANSWER or your best effort, and then ask the forum for feedback. Show that you made an attempt rather than just appearing to lazily sponge any answer/info you can soak up.

    Hope to see you around. Good luck!

  3. #3
    Junior Member
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: an exam question

    Dear Sir,
    First, I have never expected you or anybody to do any exam for me or anyone else. Second, I am not a lazy or incompetent person as a person with full of ego like you wants to do anything for him. Third, I was in a hurry for answering this question and this was why I tried to use some developers' experience to give any advisement. And finally, if you yourself don't know the answer, please don't waste my time and let others give any solution for that. Meanwhile, I will never be interested in posting on this website anymore while the directors try to give denunciation rather than presenting a solution.

    Quote Originally Posted by GregBrannon View Post
    We won't do your exam for you, and we probably sent that message by not responding as quickly as you needed. If you intend to hang around, please read this topic to learn how to post code correctly along with other useful info for newcomers.

    Hints: Avoid using topic titles like, "Exam Question," "Help with Test/Homework," or "Urgent Help Needed." Those get a laugh and are often passed by. Instead, present the problem as generically as you can and OFFER YOUR ANSWER or your best effort, and then ask the forum for feedback. Show that you made an attempt rather than just appearing to lazily sponge any answer/info you can soak up.

    Hope to see you around. Good luck!

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: an exam question

    Thanks for the advice.

Similar Threads

  1. "Help with answer to question from java 6 practice exam book!
    By StanTheMan in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 15th, 2013, 12:33 PM
  2. exam question help please_2
    By mrjavajava in forum Java Theory & Questions
    Replies: 3
    Last Post: February 4th, 2013, 09:34 AM
  3. exam question help please
    By mrjavajava in forum Java Theory & Questions
    Replies: 1
    Last Post: February 3rd, 2013, 07:59 AM
  4. exam revision question help please
    By mrjavajava in forum What's Wrong With My Code?
    Replies: 5
    Last Post: February 3rd, 2013, 06:08 AM
  5. Exam study review question
    By michael305rodri in forum Object Oriented Programming
    Replies: 3
    Last Post: October 17th, 2012, 06:10 PM