Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-31-2007, 06:20 AM
Member
 
Join Date: Jul 2007
Posts: 40
fernando is on a distinguished road
Variable passing, Error: IOException
Hi, I am working on a project and trying to get this to work.
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-31-2007, 08:06 AM
Senior Member
 
Join Date: Jul 2007
Posts: 130
cruxblack will become famous soon enough
Could u post what the error messages is?
That would be helpful for us to help
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-31-2007, 09:17 AM
Member
 
Join Date: Jul 2007
Posts: 10
nitinborge5 is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-31-2007, 04:03 PM
Senior Member
 
Join Date: Jul 2007
Posts: 134
brianhks will become famous soon enough
There is no main method. The first clearrun should be named main. Then it will work fine.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.io.IOException: CreateProcess: matlab error=2 Jack Advanced Java 3 04-10-2008 11:01 AM
Passing Environment Variable in Eclipse Europa ajaymenon.k Eclipse 0 11-19-2007 12:08 PM
Passing variable information between classes zen_to_go New To Java 1 10-30-2007 10:09 PM
java.io.IOException: invalid header field osval Advanced Java 1 08-07-2007 01:09 AM
Error: non-static variable height cannot be referenced from a static context at line fernando AWT / Swing 1 08-01-2007 11:25 PM


All times are GMT +3. The time now is 11:07 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org