Deprecated - how to solve

Hi, hope someone can help me:
I've currently written the following code:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class FracDeci extends Applet
private static final int NUMFRACS=30;
private List fracList = new List(10, false);
TextField inputNum = new TextField(20);
public void init()
Panel p = new Panel();
p.setLayout(new BorderLayout());
p.add("North", inputNum);
p.add("South", fracList);
add(p);
public boolean handleEvent(Event e)
{   String sel;
if(e.target == inputNum && e.id==Event.KEY_PRESS)
String f = inputNum.getText();
if(e.key >= ' ') printCalc(f+(char)e.key);
else if(e.key==8 && f.length()> 0)
printCalc(f.substring(0,f.length()-1));
else printCalc(f);
return super.handleEvent(e);
private void printCalc(String f)
long [] numerator = new long[NUMFRACS];
long [] denominator = new long[NUMFRACS];
double d=0, d2=0, d3, d4 = -1;
long maxNumerator, L2;
try
{   d = d2 = Math.abs((new Double(f)).doubleValue());
}catch(NumberFormatException nfe)
{   fracList.clear();
return;
maxNumerator = getMaxNumerator((new Double(d)).toString());
numerator[0]=0; denominator[0]=1;
numerator[1]=1; denominator[1]=0;
fracList.clear();
for(int i=2; i<NUMFRACS; i++)
L2 = Math.round(d2);
numerator=L2*numerator[i-1] + numerator[i-2];
denominator[i]=L2*denominator[i-1] + denominator[i-2];
d3 = ((new Long(numerator[i])).doubleValue())
/((new Long(denominator[i])).doubleValue());
if(d3==d4) break;
if(Math.abs(numerator[i]) > maxNumerator) break;
fracList.addItem(
Math.abs(numerator[i])
+"/"+Math.abs(denominator[i])
+" = " + d3);
if(d3==d) break;
d4=d3;
d2 = 1/(d2-L2);
private long getMaxNumerator(String f)
String f2 = null;
int ixe = f.indexOf("E");
if(ixe==-1) ixe = f.indexOf("e");
if(ixe == -1) f2 = f;
else f2 = f.substring(0, ixe);
String digits = null;
int ix = f2.indexOf(".");
if(ix==-1) digits = f2;
else if(ix==0) digits = f2.substring(1, f2.length());
else if(ix<f2.length()) digits = f2.substring(0, ix) +
f2.substring(ix+1, f2.length());
long L;
try
{  L = (new Long(digits)).longValue();
}catch(NumberFormatException nfe)
{  return Long.MAX_VALUE;
int numDigits = ((new Long(L)).toString()).length();
long L2 = (long)((new Double(f)).doubleValue());
int numIntDigits = ((new Long(L2)).toString()).length();
if(L2==0) numIntDigits = 0;
int numDigitsPastDecimal = numDigits - numIntDigits;
for(int i=numDigitsPastDecimal; i>0 && L%2==0; i--) L/=2;
for(int i=numDigitsPastDecimal; i>0 && L%5==0; i--) L/=5;
return L;
but it keeps throwing up the following compilation error:
FracDeci.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
Trying to run the program nonetheless, I get:
Exception in thread "main" java.lang.NoSuchMethodError: main
How would I go about solving this? Also, how would I recompile with -deprecation for details?
Thanks in advance,
Alien463

The error you get when you run the program has nothing to do with you using a deprecated method.
If you read the error you will see that it is saying you don't have a main() method.
I assume when you say "run" you mean you're typing
java -cp . FracDeci
or something similar on a command line. This is correct if you were running an application and would mean you would need a main() method, but as this is an Applet you should use AppletViewer to run it.

Similar Messages

  • I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem?

    Problem with an incoming message. For example, during my conversation the second line receives a call, I hear the sound in dynamics such as "piiiip piiiip," but when in this situation I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem? Perhaps someone tell me? save in advance

    Not Charge
    - See:     
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    - Try another cable. The cable for 5G iPod (lightning connector) seems to be more prone to failure than the older cable.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • My Airport Time Capsule only works when I turn off and turn on, but I think this may end up with the unit. What can this happening and how to solve?

    Time Capsule Airport
    Hello to all, good day, sorry my english google, but it is the tool I have at the moment. I'm having trouble with my Time Capsule Airport, I made all the settings according to the manual, but there has been a connection problem with my iMac. When I finish my work I turn off the imac and then again when they return to work and care, it can not connect to Time Capsule Airport, making it impossible to remove the files and make back up by Time Machine only works when I turn off and turn on the Airport Time Capsule , but I think this may end up with the unit. What can this happening and how to solve? Thank you.
    Olá a todos, bom dia, desculpe meu inglês google, mas é a ferramenta que tenho no momento. Estou tendo dificuldades com a minha Airport Time Capsule, fiz todas as configurações de acordo com o manual, mas tem existido um problema de conexão com meu iMac. Quando termino meus trabalhos desligo o imac e depois quando retorno pra trabalhar novamente e ligo, ele não se conecta a Airport Time Capsule, impossibilitando retirar os arquivos e fazer o back-up pelo Time Machine, só funciona quando desligo e ligo a Airport Time Capsule, mas acho que isso pode acabar com o aparelho. O que pode esta acontecendo e como resolver? Obrigado.

    This is easier to do with pictures perhaps.. since we do not share a common language and machine translation leaves a lot to be desired.
    In the airport utility bring up your Time Capsule.
    Simply post the screenshots here.
    So here is mine.
    Click on the Edit button and give us the Internet and Wireless and Network tab..
    eg.
    Please also make sure you are set to ipv6 in your wireless or ethernet .. whichever is used.. and do tell which.
    This is wifi in your computer.
    The following are important..
    DO not use long names with spaces and non-alphanumeric names.
    Use short names, no spaces and pure alphanumeric.
    eg TC name. TCgen5
    Wireless name TCwifi
    Use WPA2 Personal security with 10-20 character pure alphanumeric password.
    read apple instructions to help with TM and TC.. they did finally admit it has issues in Mavericks.
    OS X Mavericks: Time Machine problems
    Mount the TC manually in finder.
    AFP://TCgen5.local
    When asked for the password .. that is the disk access password and save it in the keychain.
    Reset Time Machine
    See A4 here. http://pondini.org/TM/Troubleshooting.html

  • I'm trying to connect my 30" Cinema Display to my new Mac Pro along with a new Apple 23'" monitor.  The new Apple monitor is fine.  On the cinema monitor everything is blown up pretty large.  Any ideas on how to solve this?

    I'm trying to connect my 30" Cinema Display to my new Mac Pro along with a new Apple 23'" monitor.  The new Apple monitor is fine.  On the cinema monitor everything is blown up pretty large.  Any ideas on how to solve this?

    The 30" display needs a DUAL-LINK adapter.
    <http://store.apple.com/us/product/MB571Z/A/mini-displayport-to-dual-link-dvi-ada pter>

  • Hi, when ever I'm using 3G, on my Iphone4 sim stops working and Network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem.

    Hi, when ever I'm using 3G, on my Iphone4 sim stops working and network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem. Thanks.

    Photos/videos in the Camera Roll are not synced. Photos/videos in the Camera Roll are not touched with the iTunes sync process. Photos/videos in the Camera Roll can be imported by your computer which is not handled by iTunes. Most importing software includes an option to delete the photos/videos from the Camera Roll after the import process is complete. If is my understanding that some Windows import software supports importing photos from the Camera Roll, but not videos. Regardless, the import software should not delete the photos/videos from the Camera Roll unless you set the app to do so.
    Photos/videos in the Camera Roll are included with your iPhone's backup. If you synced your iPhone with iTunes before the videos on the Camera Roll went missing and you haven't synced your iPhone with iTunes since they went missing, you can try restoring the iPhone with iTunes from the iPhone's backup. Don't sync the iPhone with iTunes again and decline the prompt to update the iPhone's backup after selecting Restore.

  • I Try to open an Indesign document. The message: it is made in a newer version. Go tot CC: Help/Give your Adobe id/Start Indesign again and try to open the document. This doesn't work. How to solve this problem?

    I Try to open an Indesign document. The message: it is made in a newer version. Go tot CC: Help/Give your Adobe id/Start Indesign again and try to open the document. This doesn’t work. How to solve this problem?

    What version are you running?
    What version was it made with?

  • I'm using i phone 3gs after upgraded to ios 5 few hours from shop my phone totally shutdown and cannot on.how to solve it.tq

    help..help...my i phone 3gs after upgrading to ios 5 for few hours thn my phone "pass away"total cannot on anymore.how to solve this problem.tq

    Thanks for the clarification.    Yes, I do access my email from 2 different sources. 
    FYI, I use the POP mailserver as I need most of the information to be loaded onto my PC while on a plane / not connected to the interenet.
    The primary use of mail on my iPhone is to be available as much as possible - even when I'm away from my office.
    Thanks again for your help.   I'll start deleting them in segments of 100.......

  • After installing Lion os I cannot see my desktop 1 nor can I see my open windows when I go to finder, I just get the grey/black background that comes with mission control. Any ideas as to how to solve this problem?

    The top picture is what my Desktop 1 looks like. And the picture below is what my desktop looks like after clicking mission control. Ive tried changing wallpapers, changing preferences, etc. and I still can't figure out what's wrong. As you can see, on mission control you can't see any of the open windows, or anything that I have placed on my desktop. Any ideas as to how to solve this issue?

    Hello cor-el, thanks for your reply. I changed my settings for downloads to desktop and it has appeared on there. When I double click I am asked which program I want to open file. I click firefox and another box "opening install" says I have chosen to open the file which is an application and do I want to save it. This is the only real option so I press save file. I get a box saying this is an executable file which may contain viruses - do you want to run. I press ok and the final box showing C drive file name and desktop appears stating application not found.
    This happens the same whenever I try to install.
    To my untrained eye the application is not being recognised as an application and I cannot work out how to get it to do that.
    My plugin is still showing as out of date.
    Is there anything you could suggest. Thanks for your time.

  • I have two different accounts on my iMac 2011 OSX 10.8.2. When you type text in one account, he dialed in the second account at a time. how to solve it?

    I have two different accounts on my iMac 2011 OCX 10.8.2. When you type text in one account, he dialed in the second account at a time. how to solve it?

    I have 2 users on the imac. when entering text in the first account it is duplicated in the second

  • Hello guys..!! I have got my new  iphone 4 2 days ago.The same day it got a problem of auto restart in every 1, to 2 minutes. I updated and restored it many times...but of no use... can any one help me how to solve this problem..!!

    Hello guys..!! I have got my new  iphone 4 2 days ago.The same day it got a problem of auto restart in every 1, to 2 minutes. I updated and restored it many times...but of no use... can any one help me how to solve this problem..!!

    Go to Settings/General/Reset - Erase all content and settings. the connecto to iTunes and restore as a New phone. Do not restore any backup. If the problem persists you have a hardware problem. Take it to Apple for exchange.
    This assumes that the phone is not hacked or jailbroken. If it is you will have to go elsewhere on the internet for help.

  • How to solve problem - " Safari cannot open page because it isn't connected to the internet" but the airport is ok. signal full and i have n IP address.

    How to solve problem - " Safari cannot open page because it isn't connected to the internet" but the airport is ok. signal full and i have n IP address. and i m using Macbook pro.
    OS snow leopard and above...

    Do you have this problem with all websites, or only some? If only some, which ones?

  • TS1702 Does any one know how to solve this iPod touch error: I am tryin to pay for an app but I can because it says that I don't have enough space when I actually have more than enough space to download it so please help me

    Does anyone know how to solve this problem: I a trying to download a paid app but I cannot because the AppStore says that info not have enough space to download it even though I have more than enough space so if any of you know what can solve this problem then please let me know

    The app is compressed and needs swap space to install. As a rule of thumb you need 3 times the listed size of the app available, or in your case 4.6GB. You only have 1.7GB.

  • HOW TO SOLVE THE R6034 ERROR IN ITUNES INSTALATION

    I need toknow how to solve the R6034 error in itunes instalation becouse y can´t buk up muy phone

    How to solve this ?
    #import <UIKit/UIKit.h>
    int main(int argc, char *argv[]) {
        NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
       -> int retVal = UIApplicationMain(argc, argv, nil, nil);
        [pool release];
        return retVal;

  • Hello  Simple problem - don,t know how to solve it.  With Premiere CC when I try to do a selection (click... drag... release the click) very often it stop way before the end of the move I'm swinging the Magic Mouse. I taught that the mouse clicking was de

    Hello
    Simple problem - don,t know how to solve it.
    With Premiere CC when I try to do a selection (click... drag... release the click) very often it stop way before the end of the move I'm swinging the Magic Mouse. I taught that the mouse clicking was defective and went to get a new Magic Mouse after lots of frustration. Today, I have an edit to do it it does the SAME thing !!
    I was like ????#$%?&*(???
    Opened all the lights and taught I've trow the new mouse to the garbage and was using the defective mouse again... no !! - ??
    Actually, the bran new mouse is doing the same thing. What I understand after investigating on the motion and watching carefully my fingers !! -  is that when I click I have to keep my finger at the EXACT same place on the mouse... drag and release and it's fine. If I click by pushing on the mouse and my finder is moving of a 1/32th of a millimeter, it will release and my selection will be to redo. You can understand my frustration ! - 75$ later... same problem, but I know that if I click with about 5 pounds of pressure and trying to pass my finger through the plastic of the mouse, it you stay steady and make it !
    The problem is that scrolling is enable while clicking and it bugs.
    How to disable it ??
    Simple question - can't find the answer !

    Helllooo !?
    sorry but the Magic Mouse is just useless with the new Adobe Premiere CC and since I'm not the only one but can't find answer this is really disappointing. This mouse is just fantastic and now I have to swap from a USB mouse to the Magic Mouse every times I do some editing. My USB mouse if hurting my hand somehow and I want to got back to the Magic Mouse asap. Please - for sure there is a simple solution !
    Thanks !!

  • Iphone 4 is hiting in ios 5.1.1. any one know how to solve this problem??

    iphone 4 is hiting in ios 5.1.1. any one know how to solve this problem??

    This sounds like a hardware problem and should be taken to Apple if the heating / "hiting" becomes disturbing to you. If you feel that your iPhone has a heating / "hiting" problem and needs to be repaired, please contact Apple Support and they can further assist you in having it inspected, repaired, or even replaced. In the past, the overheating of Apple products has been known to cause harmful problems to a few particular users. Please evaluate your situation and take further action if you feel necessary.
    http://www.apple.com/support/contact/

Maybe you are looking for