PDA

View Full Version : Java Help-Variable Passing


Kura_kai
04-28-2005, 03:15 AM
I am working on a project and trying to get this to work.

import java.io.IOException;

public class clearrun
{
public static void clearrun(String args[])
throws IOException
{
int a=0;
clearrun(a);
}
public static void clearrun(int a)
throws IOException
{
System.out.println(""+a);
}
}

So far it compiles correctly but when it runs it says error. The method clearrun is designed to receive a integer and display it the throws IOException is put in there as a safe gaurd from the other program accessing it using User Responses. But when i run it there is an error about main or something. Help?

shmoove
04-28-2005, 09:11 AM
In a standard Java app there is a main() method, just like in C that is the entry point of the application. It should be:

public static void main(String args[])

instead of:

public static void clearrun(String args[])


shmoove

Kura_kai
04-28-2005, 03:10 PM
oops! :eek: