General discussion

Locked

Java Kid

By lyrosely ·
Please help me! I wrote below code then I compiled it (there is no error):

//A Very Simple Example
//Area of circle
class CircleArea {
public static void main(String[] args) {
float pi, r, a;
pi = 3.1416f;
r = 10.5f;
a = r*r*pi;

System.out.println(a);
}
}

=> Then I click on Run Java Application, but on the Command Prompt showed error:
Exception in thread "main" java.lang.NoClassDefFoundError: Output
Press any key to continue . . .

What's wrong???

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

read the error message

by d_outlawstar In reply to Java Kid

there is no class to run.
yes you have a class but since its not public it will never run

Collapse -

How can I public the class?

by lyrosely In reply to read the error message

Thank so much for your advice. I already looked at the error message, but I am very new with this! So how can I edit the code? I don't know how to public the class...! :-(

Collapse -

Someone would suggest

by AnsuGisalas In reply to How can I public the clas ...

the command [pre] rt -fm /class{public.class}[/pre]
But I, being polite, would suggest you peruse one of the many manuals on the subject. Or the internet. It's usually more fun trying to learn how to write programs if you have some sort of guide on which to lean.
Otherwise too much trial and too much error.

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Forums