How can I implement a get method that lets me divide two values, Help plz

I need to implement a method that divides the values return by two other methods but I keep getting an error message, I think its divide by zero error ( I am not too sure on the exact error msg as I do not have java installed on this pc as yet), here is my example,
I have two get methods that take an int value so say
getValueOne() as method one
getValueTwo() as method two
Now I have a third method that does the following,
Public int getValueThree() {
int value =0;
value = (getValueOne() / getValueTwo())
return value;
I am not two sure on the exact code but it does something like this and I get an error. Could someone please guide me how I can successfully implement a get method that divides two values that are returned by two methods.
Thanks,
Zub

Hi, thanks for your reply. Right, how can I go about to throw an exception? I can definitely give the exact code and error message tomorrow when I can access my home pc.
And you are right there are some values that are zero! I am not very sure what throwing an exception means to be honest. Could you please give an example?
Thanks...

Similar Messages

  • How can I implement a backup 6500 that broadcasts the same OSPF networks?

    I feel as though the answer for this is extremely simple, but my routing experience is very minimal. We have a 6500 switch that shares about 10 OSPF networks, which is behind out 7200 router; and we have a spare 6500 we would like to put into place at our second location as a failover. Can I add the same OSPF networks to this second 6500, or will this cause issues since two switches will be broadcasting the same network. 
    In the case that our core 6500 goes down, i would need the other 6500 to continue broadcasting these networks. 

    Disclaimer
    The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
    Liability Disclaimer
    In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
    Posting
    Yes, it's possible for two locations to advertize the same networks, but this implies that both locations can (normally) reach all the hosts on those networks (at either location).  Also, if there's some kind of failure, some hosts (like one location's hosts) often can no longer be reached.  That's normally ok, but what's normally not okay is for hosts on the same network to be partitioned.
    Also, when you start to have networks across locations, sometimes there's requirements for hosts to logically migrate to the site that still is advertizing the host's network.
    It can all get rather complicated depending on what exactly you're trying to accomplish.

  • SCCM - How can we sync old software updates that are older than two, three years. I would like to know even if that is possible

    Hi All,
    Is it possible to sync older updates in the SCCM 2007 R2?. If yes than can some one share the links or any information on the same. That would be really helpful.
    Regards,

    Hi,
    SCCM 2007 will synchronize all updates that you can deploy, that is not superseeded or expired, There is no way to deploy an update that is expired. In Configuration Manager 2012 you can control when a superseeded update is expired, in SCCM 2007
    you cannot.
    If you need to deploy an update that is superseeded or expired I would recommend that you download it manually and deploy it as a package instead.
    Regards,
    Jörgen 
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • How can I make importing faster? Have diff speeds on diff comps, help plz

    I have 2 diff comps that both have Itunes 8, but for some reason they both import at completely different speeds even though the import settings are set exactly the same. And to make it more frustrating the older comp (7-8yrs old) is actually faster to use to import than my newer comp (not even 2yrs old). Newer comp only imports at an average of 3.1xs while the older one does double that @ 6.3xs, why is that and how do I change it to match or even make a lil fater than that?

    Done.
    (iMac OS X Lion)
    I use an Ethernet Cable Modem. I dont use a router. For trouble shooting I havnt done much. Just changed the name of my sharing WiFi, tried to connect again and again, other passwords, other channels - nothing helped. (I had this problem ones, but I just changed a name, and it has worked)
    When I'm clicking on my WiFi it shows me "The connection with "(null)" failed. The connection is timed" or something like this. I have a german language, so it would be: "Die Verbindung mit „(null)“ ist fehlgeschlagen. Bei der Verbindung ist eine Zeitüberschreitung aufgetreten.", if you speak it.

  • How can i buy songs off itunes that you can't get on the Canadian version but you can in the u.k. version

    How can i buy songs off itunes that you can't get on the Canadian version but you can in the u.k. version
    I would really like to get these songs (not illegally like most people) because i really like them but they are only in the U.K. or Irish version of iTunes and I'm on the Canadian version
    If anyone can tell me how i could possibly get these that would be great thanks

    OS X is the same no matter where you buy it.  You can switch it to Japanese or one of 30 other languages in few seconds via the system preferences.
    If you want a Japanese keyboard as well, you can select that when you configure your purchase:
    http://store.apple.com/us/configure/MD093LL/A?

  • In iMovie 11, how can you cut/paste a clip that has subtitles and actually have the subtitles get cut/pasted. When I try, the subtitles disappear into the void and I have to do the subtitling all over again.

    In iMovie 11, how can you cut/paste a clip that has subtitles and actually have the subtitles get cut/pasted. When I try, the subtitles disappear into the void and I have to do the subtitling all over again.

    If you think this is a bug, you can report it here:
    Apple - Mac OS X - Feedback

  • How do i get a list of all Roles defubed under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?

     

    Sorry for the typographical mistake.
    Please read the question as:"How do i get a list of all Roles defined under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?"

  • I am trying to sync music from my iTunes library on my iMac to my iPhone. I only want selected music but I'm getting unwanted songs. How can I delete those songs on my iPhone or how can I prevent these unwanted songs that have not been selected from appea

    I am trying to sync music from my iTunes library on my iMac to my iPhone. I only want selected music but I'm getting unwanted songs. How can I delete those songs on my iPhone or how can I prevent these unwanted songs that have not been selected from appearing on my iPhone? Help!

    http://support.apple.com/kb/HT1296

  • If I'm suspecting that I'm hacked, how can I confirm it and how can I Un-hack/get rid of it ?

    If I'm suspecting that I'm hacked, how can I confirm it and how can I Un-hack/get rid of it ?
    Knowing that when I turn On my Macpro, the Apple logo appeares late and always when Im connected to the WiFi It notifys me that there is someone using my IP address!!

    You aren't being hacked. Your wireless network is probably misconfigured and/or hacked. Turn on WPA security and then reboot it.

  • I made a new apple id and after that i cant get my updates from my iTunes on my pc. How can I do to get it back

    I made a new apple id and after that i cant get my updates from my iTunes on my pc. How can I do to get it back

    Sign out from the new Apple ID with iTunes on your computer and sign in with your old iTunes account with iTunes.

  • My computer crashed and I lost my iTunes library, On my new computer I downloaded iTunes and some of my songs were there. Although I lost my movies that I had purchases on iTunes, which of course cost quite a lot. How can I go about getting these back?

    My computer crashed and I lost my iTunes library, On my new computer I downloaded iTunes and some of my songs were there. Although I lost my movies that I had purchases on iTunes, which of course cost quite a lot. How can I go about getting these back?

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • HT1688 How can I put a secondairy email that my kids use for there apple account? I need to use this one to to get my maill.

    How can I put a secondairy email that my kids use for there apple account

    As it seems Gmail doesn't accept kids email accounts, but hotmail and yahoo are said to do. I've not managed to set up one for my daughter though! good luck!

  • How can we identify the coupon code that triggered the promotion discount in the order?

    Hi,
    As we can create the coupons and assign the promotions to them to give discounts.How can we identity the coupon code that is added the promotion which caused the discount in the order?
    Regards,
    Chede

    I'm giving you an example. Here is how you do it starting with order level promotions. OrderImpl object API below give you orderpirceinfo and second link gives adjustments.
    http://docs.oracle.com/cd/E35319_01/Platform.10-2/apidoc/atg/commerce/order/OrderImpl.html#getPriceInfo()
    From OrderPriceInfo which extends AmountInfo, the following method gives adjustments
    http://docs.oracle.com/cd/E35319_01/Platform.10-2/apidoc/atg/commerce/pricing/AmountInfo.html#getAdjustments()
    Now iterate through adjustments, to get pricingmodel(which is promotion) and coupon applied on order
    PricingAdjustment (ATG Java API)
    PricingAdjustment (ATG Java API)
    Hope this gives you an idea where to start with.
    -karthik

  • How can I implement data type map?

    The getString() method of java.sql.ResultSet interface is not efficient enough.
    I want to map any data type to VARCHAR type,then use the getBytes() method to get the value.
    How can I implement it.
    I know proc can implement it, simply set selda->T[sli] with 1 for any field.

    Hello,
    What's your LabVIEW version ? Do you have a simple example program which demonstrates this behavior ?
    I found another discussions related to your issues with Xcontrols:
    updating type defs in Xcontrol Facade
    No Data Change event generated for a XControl in a Type Def
    XControl facede.vi 
    Hope this helps.
    Regards, 
    Steve M.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Vidéo-t'chats de l'été : présentations techniques et ingénieurs pour répondre à vos questions

  • How can we implement a regular expression in if condition?

    hi,
    could any body tell me how can we implement regular expression in if condition?
    if a page contains links with .html,.pdf,.img etc as href paths then i should only retrieve the links whose href path is .pdf .
    any idea
    thanks in advance

    Pasumarthi,
    Here is some VBA that should do the trick. This was created against the empirix homepage. www.empirix.com.
    Private Sub RSWVBAPage_afterPlay()
    Dim objReg As New RegExp
    Dim objMatch As Match
    Dim doc As String
    'Get the html
    RSWApp.GetHtml doc
    'set parameters for regular expression searching and matching
    With objReg
        'find all occurances
        .Global = True
        .IgnoreCase = True
        'regular expression pattern specified here
        .Pattern = "a href=(.+?)pdf"""
    End With
    'Loop through the matches and write them to the results log.
    For Each objMatch In objReg.execute(doc)
        RSWApp.WriteToLog objMatch.Value
    Next
    Set objReg = Nothing
    End Sub

Maybe you are looking for

  • Bought eMac with 10.4.3 but no OS disks - need administrator password

    Just bought an eMac (1.25 GHz) with system 10.4.3 installed from the local Goodwill computer store. Boots and runs fine. However, to load some CDs and run DVDs, it requires the administrator password, which I don't know. The administrator is listed a

  • How do I get to see the lyrics for a song?

    On my old iPod I just pressed the center button in the wheel to get them to view. I tap the screen of my iPod Touch, while a song with lyrics is playing, and nothing appears. Am I doing something wrong?

  • Difference beetween QAASW and Web Service Connections

    Hi everybody, I'm trying to install a connection between Xcelsius and a QaaWS I created, but it doesn't work. In the list of the different connections available in the Xcelsius Connections Manager, the "QaaWS" connections doesn't appear. Instead of t

  • Click the lock to make changes

    I have a clean install of Mountain Lion OS X on a Mid 2010 Macbook Pro.  I'm running into a problem when I go to click on the lock in any System Preferences window.  I go to click on the lock and nothing happens.  It does a short stutter, but then I

  • Dashboard won't Start Up

    I have read other posts where it starts but there are no widgets. Mine just won't start. When I click on the icon it looks like it is going to open but then never does. I have tried repairing permissions. The account I am in IS an admin account. A ne