Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

program error

  Asked By: Gene    Date: Jan 22    Category: Java    Views: 757
  

can anyone tell me why the foll. program is not working.
i have also mentioned the error that occured when i interept the
program

"program"

import java.awt.*;

import java.applet.*;
public class Circle extends Applet
{
public void paint(Graphics g)
{
g.drawString("Sriram Web Page",20,20);

}
}



"error"

C:\jdk1.2.1\bin\prog>javac Circle.java

C:\jdk1.2.1\bin\prog>java Circle
Exception in thread "main" java.lang.NoSuchMethodError: main

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Jonathan Harrison     Answered On: Jan 22

Program is perfectly right.
you were trying to run it as an application.
this is applet.
use command
jview /a Circle on the dos prompt after comilation

import java.awt.*;

import java.applet.*;
public class  Circle extends Applet
{
public void  paint(Graphics g)
{
g.drawString("Sriram Web Page",20,20);

}
}

 
Didn't find what you were looking for? Find more on program error Or get search suggestion and latest updates.




Tagged: