How does it work : String MethdName (argument) throws Exception {}

HI,
I am very new to Java. I was looking through some code written by some other developer.
the code looks like
String MethdName (argument) throws Exception {
// some code here
What it exactly means? Are we forcing this method to always throw an exception? or only if some exception occurs then it will throw the exception?
Regards,
Lucky

It doesnt throw exceptions always.
What this means is that if you code inside the method does use some API or function that throws exceptions when a particular condition is not met, you method would throw the same exception to it's caller. If you didn't add the throw exception clause in your method, you would have to try/catch the exception that would be thrown in your code.
Or else, your code won't compile.
Summary:
A method that throws an uncaught, checked exception must include a throws clause in its declaration.
Read this for some additional info:
[Java Exception Handling|http://ajaxweb.wikidot.com/java-exception-handling]
[Sun Java Tutorial - Exceptions|http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html]

Similar Messages

  • Corecell, how does it work?

    Hello!
    I'm being puzzled by Corecell features. MSI web pages tell me that Corecell has four different settings (Speedster, Buzz free etc.). I have installed Core Center (ver. 1.6.1.0) but there is no possibility to change into Buzz free mode.
    How can it be changed? I have found fan controls and auto-button but do I have to make settings by my self? Auto-button does not have any effect!
    Thanks in advance for your help!
    Niko
    system specs:
    Antec 380W True-Power
    MSI KT6 FISR
    AMD Athlon XP 2600+ Barton
    512Mb DDR400
    80Gb Samsung S-ATA HDD

    You gotta throw use a bone here... How does what work? More info please.

  • Syncing Skype: How does it work?

    Hey guys, I'm running Skype on my Mac, but I'm about to install Skype on my Windows 8 PC. Before I login to my Skype account on my Windows 8 PC I just wanted to know where my 'Favorite Contacts' and 'Renamed Contacts' are located. If I login on my Windows 8 PC will I still have all of the contacts I've renamed and my favorite contacts I've created on my Mac?
    Thanks!

    You gotta throw use a bone here... How does what work? More info please.

  • How does Iterate work inside an Action

    I'm having trouble figuring out how does <Iterate > work inside an <Action> in a workflow. My <Action> is to call a subprocess that takes several arguments and initiates an approval. Since I need to fire-off several approvals at the same time instead of chaining them I use <Iterate> that loops over a list variable.
    Now the subprocess being an approval the workflow gets suspended and divided into multiple parallel paths. My question is that how do these parallel paths assimilate together after approval or they don't assimilate at all and process in separate parallel lines or otherwise whichever approval returns first takes precedence and proceeds with rest of the activities.
    TIA,
    AndyDev

    Thanks for the reply. But this doesn't answer my question completely.
    Say within <Iterate> I specify **for='var_name' in='list_name'** will it continue to run after it has run once for each element in the list. If yes, doesn't it trigger the sub-process multiple times, something I don't want. If no, what happens next ? (that was actually my original ques).
    Say if list_name had 5 elements, it triggers one sub-process (which is a multiapproval) for each of them. What happens next ? Does it transition to next activity? Does it wait for all approvals to finish approve/reject?

  • UIFONT.ALI - How does it work??

    Hi everyone,
    i'm having some problems on understand how the uifont.ali works, so i can print reports on PDF formar using a barcode font.
    I'm using Red Hat Linux 7.3 and 9iAS release 2 with 2703110 and 2842923 patches installed and working.
    The following part of the uifont.ali file maps Windows Fonts (left side) to Unix Fonts (right side), right??
    [ Global ] # Put mappings for all surfaces here.
    # Mapping from MS Windows
    Arial = helvetica
    I2501P = I2501p
    "Courier New" = courier
    "Times New Roman" = times
    Modern = helvetica
    "MS Sans Serif" = helvetica
    "MS Serif" = times
    "Small Fonts" = helvetica
    # Mapping from Macintosh
    "New Century Schlbk" = "new century schoolbook"
    "New York" = times
    geneva = helvetica
    My question is:
    In wich directory of Red Hat Linux 7.3 the Unix Fonts (right side) are installed??
    I tried to install a new barcode (I2501P.ttf) font on Linux, but the uifont.ali file is not recognizing my new font.
    I'm mapping the font like this and it's not working :
    I2501P = I2501p
    (name of the font installed on Windows) = (name of the font on Unix)
    Is that right??
    I think the font (I2501P.ttf) is correct installed on Linux because it appears on the list of fonts of all the kde editors using the name I2501p.
    But when i do following mapping:
    "I2501P = helvetica" or "I2501P = courier" or "I2501P = lucida"
    it does work, but the barcodes are showing up unformatted.
    What about the $ORACLE_HOME/guicommon9/tk90/admin/AFM directory??
    I've created an AFM (I2501P.afm) file of my font there, but when I do the mapping:
    I2501P = I2501P
    it still doesn't working...
    Anybody can help??
    I need to know from where the uifont.ali file takes the fonts helvetica, courier and lucida with urgency, so i can install my font file on the same place.
    Thank you all.
    Marcus Santos
    ([email protected])

    You gotta throw use a bone here... How does what work? More info please.

  • Referenced objects : how does it work ?

    Hello
    I would like to design a table, with 2 rows.
    Within the first row, a combo modifies the content of the second colum regarding its value.
    I believe I should use referenced objects (under the Referenced Objects nod in hierarchie tab), because "A referenced object is an object that is added to a form only when it is required", but I do not understand how it works.
    I've added a subform to the tree "referenced objects" ; using javascript let me access this subform, but when previewing the code does not work
    would anybody point me a link/a doc out ?
    thanks a lot !

    You gotta throw use a bone here... How does what work? More info please.

  • JScrollPane, JList, Resizing - How does it work?

    Hello NG,
    I have the following situation:
    3 JScrollpanes with 3 JLists to display. 2 Scrollpanes (on the right, 2. and 3.) are in a JPanel with GridBagLayout. This JPanel and the 3rd JScrollpane (on the left, 1.) are in another JPanel also with GridBagLayout. All components have a gridBagConstraints.fill = BOTH setting for resizing. The JLists will be filled from another Thread different from the EventDispatcherThread.
    The Problem:
    The JFrame with the components above will be displayed on the screen. Then the other thread fills the JList of JScrollpane(1), then the two other JScrollpanes (2 and 3). After that, a resizing occurs according to the gridBagConstraints.fill constraint to fill the space between the components. So, the 3 JScrollpanes change their size, it seem to the observer that this resizing occurs without intention.
    Is there a way to prevent this risizing? How does this resizing mechanism exactly works? Who fires which event? Does anybody knows where to find a good description of it?
    So far, I know it starts with the revalidate()-method in the JLists after changing the content of the lists. revalidate() adds the component to the RepaintManger invalidation queue for repainting. But who calls revalidate()? What will happen if the revalidate()-method will be overwritten to do nothing?
    Bye
    Raoul

    You gotta throw use a bone here... How does what work? More info please.

  • How does this work?

    This is not a complaint, but a confused sigh of admiration. I've got an email account at the university where I teach. When I got my iBook, it took me a while, and a few conversations with IT at the school, to get this account working in the Mail application. (Since I have a Verizon DSL at home, I had to include that SMTP as the outgoing server.) Anyway, I synched this mail account (along with my AOL and .Mac accounts) onto the iPhone, and it works perfectly, both incoming and outgoing. I didn't have to change any of the settings. I thought I was computer savvy, but I can't wrap my mind around this. It seems like magic. How does it work?

    The sync process with iTunes transfers the email account settings (for your chosen accounts via your iPhone sync preferences) from the Mail application on your Mac to the iPhone's email application.
    The iPhone is running OS X and the iPhone's email client can be considered a mobile version of the Mail application.

  • My iPhone was stolen and I have contacted the police who are using the meid number to locate.  How does this work and what are my chances of getting the phone back?

    My iPhone was stolen.  I used Find My iPhone app to lock it and display a message.  The phone has not connected to the internet to locate it.  I contacted the police and they have taken my meid number.  How does this work and what are my chances of getting the phone back?  Are there other ways the theif can use it.  I was told once they put in a new sim card and use it, whatever software the police have, it will show up.

    Honestly? In the US (I can't speak to other countries, though I doubt it works much differently in a lot of the world) The police took your report and filed it either in their computers or, on paper. They will now not think of this again. The only time it will cross anyones mind is if, in the course of entering information into evidence about items recovered or seized at a crime scene, the serial number of an iPhone that was found/seized happens to match yours, in which case you will be contacted.
    The police in the US can and will do nothing to 'blok' the phone and it's not worth their time to try and locate it unless you know for a fact that it was stolen by a big time drug lord, master criminal, or some other such prime target and they can get a court order to track the location of the phone in order to locate this individual for your own purposes.  If they do that, they'll probably keep him under surveilance for a year or so before they act.
    Basically, the police don't care about your phone. If they find it, they will give it back to you. They are not, however, going to go looking for it. They have better things to do.
    I'm sorry, but that's the way it is.

  • Was told a USB device would create a PDF automatically from the data contained within when plugged into my USB port. Doesn't seem to work. How does this work and how can I fix the device I received?

    Acrobat is not on the USB device - only Adobe Reader needed on the PC. How does this work? How can I fix this device if at all?

    You need to ask the people who sold it to you. Doesn't sound like it has anything to do with Reader.
    However, you should be wary of devices that automatically try to open files when plugged in. They can also infect your computers with all kinds of viruses or malware.

  • HT2357 So how does this work on Mountain Lion? I cannot seem to ignore the iTunes 11 updates, which now seem to appear every 5 minutes!!

    So how does this work on Mountain Lion? I cannot seem to ignore the iTunes 11 updates, which now seem to appear every 5 minutes!!

    Fantastic!  Didn't work at first so restarted App store and tried again.  This time it asked 'ignore update'.  All gone!

  • TS1425 My co worker has given me his iPod to take home and transfer his music to my laptop, however, I am unable to access his music to download it to my computer.  How does this work?

    My co-worker has given me his iPod to take home and transfer his music to my laptop, however, I am unable to access his music to download it to my computer.  How does this work?

    You need to transfer the iTunes Library from the most recent backup you made before the hard drive was replaced.
    You can't transfer the full iTunes Library from the iPad back to iTunes.
    There are third-party Windows applications that will transfer data from an iOS device, but they don't re-create the iTunes Library exactly as it was before.

  • How does Remote work with Apple TV?

    How does Remote work with Apple TV?
    1. Does Remote, "Play" the music that resides on your iPod Touch>Apple TV>Home Speakers.
    OR
    Does Remote "Control" the music that resides on Apple TV HD>Home Speakers.
    (If so... say you have a iPod Touch that only holds 8GB's but your music collection on your Apple TV exceeds that amount.
    Will Remote still "Control" the larger music collection on Apple TV or your computer?)
    2. Will iPod Wifi work on a patio outside a home to control Apple TV inside the home?
    thank you in advance, Tom

    Remote is a way to control iTunes on either your computer or Apple TV using a WiFi connection. See this article for complete instructions.

  • I got a itunes gift card and when i try and buy some thing it asks me for my credit card details how does that work when i have £15 on my fone that i got on a gift card?

    i got a itunes gift card and when i try and buy some thing it asks me for my credit card details how does that work when i have £15 on my fone that i got on a gift card? as i am trying to buy a song and it is starting to really cheese me of now where it keeps asking for credit card details is there a way round it with out having to use a credit card?

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • I would like to know which app/software in MAC gives us the same feature that is provided by System Restore in Windows, and how does that work

    I would like to know which app/software in MAC gives us the same feature that is provided by System Restore in Windows, and how does that work.

    Time Machine is one such program, although it is a recursive backup program which offers limited archive capability, based on the capacity of the backup destination, and it requires you set it up before you start editing your files.   Some programs are also Versions aware, which offers a kind of restore capability by file.  Again needs to be setup before you start editing.
    Just a for-your-info:
    Mac is not an acronym, it is a nickname for Macintosh.

Maybe you are looking for