Why its not a good idea to have a return statement in a finally block?

deepak

Finally executes after the try block has finished doing its work--either successfully or not. Finally is only for cleanup that has to be run after try finishes, regardless of how try completes. It's up to the try block to handle the business logic, the real work.
If the real work in the try block says, "return x," then it is not appropriate for finally--the cleanup code--to alter that with "return y" or "throw new Exception()".
If the real work in the try block throws an exception, it is not appropritae for the cleanup code to throw a different exception, or change that to a return.
Remember, if you throw or return from within finally, that will superceded whatever your mode of completion in the try block was.

Similar Messages

  • Hi I think its not a good idea to have "airplane mode" in Control center because if you lost your iphone person who find it could active it easy and you never find it

    Hi I think its not a good idea to have "airplane mode" in Control center because if you lost your iphone person who find it could active it easy and you never find it

    You can leave Apple your feedback here.
    You can disable Control Center on the lock screen here:
    Settings > Control Center

  • HT1222 I like the new iOS 7 for iphone... But i think it's not a good idea to allow switch the iphone on flight mode when it is locked.. What happens if your iphone is stolen or lost? You couldn't be able to locate it using find my iphone... Can i remove

    I like the new iOS 7 for iphone... But i think it's not a good idea to allow switch the iphone on flight mode when it is locked.. What happens if your iphone is stolen or lost? You couldn't be able to locate it using find my iphone... Can i remove this from the bottom menu?

    And have your phone set to require a passcode before it can be accessed.

  • Plz help why its not compiling ,

    hello all i am trying to make the tutorial http://developers.sun.com/mobility/midp/articles/tutorial2/
    i have made all the steps once i try to compile it it shows the folowing error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Wrapper cannot find servlet class HitServlet or a class it depends on
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:836)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:613)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:164)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    etc.....
    i believe the error has something to do with my classpath thats why its not compiling the HitServlet.java
    if anybody can show me plz how to make this following step :
    Compiling the Servlet
    Compiling servlet code is pretty much the same as for other Java development, except for an important twist. Because the servlet API is not a core part of the Java SE platform, you'll need to add it to your CLASSPATH before you can compile servlets.
    The servlet API is contained in common/lib/servlet.jar under the Tomcat root directory. Simply add this file to your CLASSPATH and you will be able to compile HitServlet.java using javac. You can edit the CLASSPATH in the system properties or do it on the command line, as this Windows example demonstrates:
    C:\>set CLASSPATH=\jakarta-tomcat-4.1.31\common\lib\servlet.jar
    C:\>javac HitServlet.java
    i have installed the tomcat and its working fine but i dont understand how to set the classpath , i tried to make it in control panel / system / envirement and put the classpath but its still doesnt work
    please help on what i should make in my classpath and how to set it to work if not please notify me where am i making mistake thank you
    appreciate a lot help

    hello all i am trying to make the tutorial http://developers.sun.com/mobility/midp/articles/tutorial2/
    i have made all the steps once i try to compile it it shows the folowing error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Wrapper cannot find servlet class HitServlet or a class it depends on
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:836)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:613)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:164)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    etc.....
    i believe the error has something to do with my classpath thats why its not compiling the HitServlet.java
    if anybody can show me plz how to make this following step :
    Compiling the Servlet
    Compiling servlet code is pretty much the same as for other Java development, except for an important twist. Because the servlet API is not a core part of the Java SE platform, you'll need to add it to your CLASSPATH before you can compile servlets.
    The servlet API is contained in common/lib/servlet.jar under the Tomcat root directory. Simply add this file to your CLASSPATH and you will be able to compile HitServlet.java using javac. You can edit the CLASSPATH in the system properties or do it on the command line, as this Windows example demonstrates:
    C:\>set CLASSPATH=\jakarta-tomcat-4.1.31\common\lib\servlet.jar
    C:\>javac HitServlet.java
    i have installed the tomcat and its working fine but i dont understand how to set the classpath , i tried to make it in control panel / system / envirement and put the classpath but its still doesnt work
    please help on what i should make in my classpath and how to set it to work if not please notify me where am i making mistake thank you
    appreciate a lot help

  • Use of flash buttons - not a good idea?

    Hi guys
    I've been advised in an earlier post against the use of flash
    buttons. As someone relatively new to Adobe products I'm interested
    to know how flash buttons don't seem to be supported but flash
    moves or indeed flash websites are in abundance and seemingly have
    no problems, or personally speaking I've not had problems viewing
    such websites in the past. I'm not contending the opinion I was
    given but as someone on a learning curve I think it would be
    invaluable to learn how one works and not the other.
    Also, what would be a suitable alternative to flash buttons,
    I'm considering using jpg images which change on mouse-over using
    javascript.
    Mike

    sigh - i was trying to be nonjudgemental. one may have a site
    where seo is a nonissue and they know that their audience has the
    latest flash-equipped browser (like mine, for example. while i
    choose to not use flash for different reasons, i don't rely on
    search engines as a meaningful source of business and/or leads.)
    quote:
    Originally posted by:
    Newsgroup User
    I'll say it. It's the mark of the amateur, and DEFINITELY not
    a good idea.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "joeq" <[email protected]> wrote in message
    news:gl8igt$am9$[email protected]..
    > not saying they're a good idea or a bad one - but my
    understanding is that
    > flash buttons are a) potentially not accessible to all
    your users, b) not
    > indexable by search engines, and c) more labor intensive
    to update. all or
    > none
    > of these things might matter to you based on the target
    audience of your
    > site.
    >

  • When m posting something on facebook why its not showing via iphone

    Hello!this is hakana m having a problem when m posting something on faceook why its not showing via iphone....

    You'd really have to ask FaceBook that.

  • HT204053 why are not all my songs I have purchased in the itunes store and are on my computer not on my phone?

    why are not all my songs I have purchased in the itunes store and are on my computer not on my phone?  Very frustrating I purchaed almosta $100 worth of songs for a trip and they are not on my phone after continuious syncs.  Do I have to pay for itunes match for this?

    Welcome to the Apple Community.
    Have you actually selected them to be synced to your device from the iTunes sync settings.

  • I want to reset my privacy questions for my apple i.d. But when i request to do so it sends it to a email address that isnt on my file can anyone tell me why its not working?

    I want to reset my privacy questions for my apple i.d. But when i request to do so it sends it to a email address that isnt on my file can anyone tell me why its not working?

    1)  Apple ID: All about Apple ID security questions
    Torrifromny wrote:
    I want to reset my privacy questions for my apple i.d. But when i request to do so it sends it to a email address that isnt on my file ?
    2)  See Here.  Apple ID: Contacting Apple for help with Apple ID account security
    Ask to speak with the Account Security Team...
    3)  Or Email Here  >  Apple  Support  iTunes Store  Contact

  • I have restored my new replacement iPhone 5s from my latest iCloud back up. However my camera roll pictures are not displaying. Its not saying i don't have any pictures, it just shows empty white squares? How do I get my pictures back? Thanks!

    I have restored my new replacement iPhone from my latest iCloud back up. However my camera roll pictures are not displaying. Its not saying I don't have any pictures in my camera roll, it has all the spaces for them, but it just shows empty white squares? How do I get my pictures back? Thanks!

    It's difficult to say whether it's stuck or not as the time to restore a backup can depend on many factors.  You'll have to decide when you think it's just not continuing.  You could try turning the phone off (hold the power button until you see the red off slider, then slide to turn off), then back on to see if that would get it going again.
    When you're convinced it's just hung, you can go back to settings and tap Stop Restoring iPhone to stop the restore.  You'll then have to try restoring it again (Settings>General>Reset, tap Erase All Content and Settings, go through the setup screens and when given the option, choose Restore from iCloud Backup).  Be sure it's connected to your charger and wifi while it's restoring the backup.
    You might also try the approach posted here by ezjules: https://discussions.apple.com/message/19518589#19518589.  This seems to have worked for some people who had trouble restoring their photos from an iCloud backup.

  • Last night i have used my ipod and in morning i found it dead please help me its not responding at all i have tried evry thing

    last night i have used my ipod and in morning i found it dead please help me its not responding at all i have tried evry thing

    Charge the battery.
    If necessary, restore the iPod >  iTunes: Backing up, updating, and restoring your iPhone, iPad, or iPod touch software

  • Can i change apple id to update a game? if its possible how i can change it? if its not possible why in this generation why its not possible?

    can i change apple id to update a game? if its possible how i can change it? if its not possible why in this generation why its not possible?

    You can't. All apps, and any other content from the store, are tied to the account that downloaded them, and they will remain tied to that account - so only the account that bought/downloaded an app can download updates to an app. Are you having problems downloading an app update via the app's own account ?

  • HT203548 I'm having problems with Siri on my iPhone 6.  It worked briefly yesterday and now its not doing anything.  I have turned phone off and on and made sure everything is on in settings.  Please help!

    I'm having problems with Siri on my iPhone 6.  It worked briefly yesterday and now its not doing anything.  I have turned phone off and on and made sure everything is on in settings.  Please help!

    Do you have an active data connection (wifi or cellular)? Have you tried resetting the phone by pressing and holding the Home and power buttons until the apple appears (this is different than just turning it off and back on).

  • Hello, my mail is gone and I can't find it anywhere. Its not in library and I have not configured Time Machine yet. Help please?!

    Hello, my mail is gone and I can't find it anywhere. Its not in library and I have not configured Time Machine yet. Help please?!

    Use Find Any File, if the old messages might have been in a specific mailbox, to look for a file by the name of the mailbox to see if there are any larger versions of that mailbox.
    http://apps.tempel.org/FindAnyFile/
    If your Mail is indeed gone, you may be able to recover it with one of the data recovery tools here:
    https://discussions.apple.com/docs/DOC-1689
    But act quickly.  Every action while the computer is turned on weakens its chances of recovery.  There is a slim chance also your email provider may have tape backup from before you checked your messages and after it arrived at their server for certain messages.  You may want to ask them if that might have happened.

  • On my 3gs keep getting error message charging not supported with this accessory even when its not plugged in and i have done a restore anyone know how to fix

    on my 3gs keep getting error message charging not supported with this accessory even when its not plugged in and i have done a restore anyone know how to fix

    Clean the iPhone charging port with a clean dry toothbrush.

  • Why are flash buttons not a good idea?

    I'm trying to figure out a problem I'm having with flash
    buttons (mainly that I don't want users to have to click twice to
    make them work), and I keep seeing posts (particularly by Murray)
    asking if the poster knows that flash buttons aren't a good idea.
    However, I was unable to find an explanation as to
    why they are a bad idea. Can anyone explain this to me in
    layman's terms? I'm very new to Dreamweaver and web development in
    general. I'm developing an intranet site for a specific group of
    users where accessibility is not a huge concern.
    Thanks!

    Consider these scenarios -
    1. I don't have Flash installed. I don't get the benefit of
    your Flash
    navigation element.
    2. I am a search engine spider. I don't get the benefit of
    your Flash
    navigation element.
    Need I say more? 8)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "bhkate" <[email protected]> wrote in
    message
    news:eki4lp$99u$[email protected]..
    > I'm trying to figure out a problem I'm having with flash
    buttons (mainly
    > that I
    > don't want users to have to click twice to make them
    work), and I keep
    > seeing
    > posts (particularly by Murray) asking if the poster
    knows that flash
    > buttons
    > aren't a good idea. However, I was unable to find an
    explanation as to
    >
    why they are a bad idea. Can anyone explain this to me in
    layman's
    > terms? I'm very new to Dreamweaver and web development
    in general. I'm
    > developing an intranet site for a specific group of
    users where
    > accessibility
    > is not a huge concern.
    >
    > Thanks!
    >

Maybe you are looking for

  • Events randomly moved to deleted items folder.

    I have a user that is using a Macbook Air with Outlook 2011 for Mac, iPhone and iPad in an Exchange 2010 environment and she is seeing random events moving to the deleted items folder.  I have run Calcheck on her Calendar and it returns no errors.  I

  • Hide and unhide button..how?

    Guys, need you help. action script...below is the situation. I have 3 entry box 1. name1 2. name2 3. name3 I have 1 image button and 1 click button. 1. image button.. called "button1" 2. click button.. called "click1" how do use action script to do t

  • Intrastat Data in PO from SRM

    Hi, We are on SRM 3.0 (BBPCRM 4.0) SP11. Currently we have intrastat requirements wherein when the intrastat conditions are met the PO should contain the intrastat data (commodity code, country of origin etc.) which will be picked up from R/3 Materia

  • 10.1.3 JMS Cache Synchronization on OC4J

    Hi, We're using stand-alone OC4j 10.1.3.0 along with TopLink 10.1.3.0 (packaged with OC4j). In enabling JMS cache synchronization, I get the following error message: Exception [TOPLINK-12000] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118

  • TS3221 error on update 5.1 iphone 4s

    my iphone 4s was doing an update to ios 5.1 which an error occured and has now locked my phone on usb and itunes icon and im unable to reset or turn my phone on/off wat can i do