Results 1 to 4 of 4
  1. #1
    fernando is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default Variable passing, Error: IOException

    Hi, I am working on a project and trying to get this to work.
    Java Code:
     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.
    Thanks.

  2. #2
    cruxblack is offline Senior Member
    Join Date
    Jul 2007
    Posts
    130
    Rep Power
    0

    Default

    Could u post what the error messages is?
    That would be helpful for us to help

  3. #3
    nitinborge5 is offline Member
    Join Date
    Jul 2007
    Posts
    10
    Rep Power
    0

    Thumbs up

    Hi fernando

    when i tried your code that time it is working fine

    there may be problem becouse of class name so pls if still error
    is there pls send that error but your code is working fine.

  4. #4
    brianhks is offline Senior Member
    Join Date
    Jul 2007
    Posts
    135
    Rep Power
    0

    Default

    There is no main method. The first clearrun should be named main. Then it will work fine.

Similar Threads

  1. Replies: 3
    Last Post: 04-10-2008, 09:01 AM
  2. Passing Environment Variable in Eclipse Europa
    By ajaymenon.k in forum Eclipse
    Replies: 0
    Last Post: 11-19-2007, 10:08 AM
  3. Passing variable information between classes
    By zen_to_go in forum New To Java
    Replies: 1
    Last Post: 10-30-2007, 08:09 PM
  4. java.io.IOException: invalid header field
    By osval in forum Advanced Java
    Replies: 1
    Last Post: 08-06-2007, 11:09 PM
  5. Replies: 1
    Last Post: 08-01-2007, 09:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •