Jump to content

Build Theme!
  •  
  • Infected?

WE'RE SURE THAT YOU'LL LOVE US!

Hey there! :wub: Looks like you're enjoying the discussion, but you're not signed up for an account. When you create an account, we remember exactly what you've read, so you always come right back where you left off. You also get notifications, here and via email, whenever new posts are made. You can like posts to share the love. :D Join 91679 other members! Anybody can ask, anybody can answer. Consistently helpful members may be invited to become staff. Here's how it works. Virus cleanup? Start here -> Malware Removal Forum.

Try What the Tech -- It's free!


Photo

FileNotFoundException


  • Please log in to reply
2 replies to this topic

#1 james411

james411

    New Member

  • New Member
  • Pip
  • 1 posts

Posted 03 May 2013 - 07:21 PM

Hi, I'm working on this GUI program and I needed to call a method from another class which throws an exception. I tried doing this: Scanner s; s=UsingFiles.setFileScanner("board1") throws FileNotFoundException; But it says I need a semicolon after ("board1"). I did that and it said that "throws FileNotFoundException;" is not a valid expression. Please help!!!!

    Advertisements

Register to Remove


#2 inzanity

inzanity

    ♠♠lost♠♠

  • Malware Team
  • 2,340 posts

Posted 06 May 2013 - 09:13 PM

Hi :welcome:

What programming language are you using? Can you post the whole source code?

FileNotFoundException simply means that the program can not find the specified file. In this case I think it's board1.

Proud graduate of WTT Classroom


The help we provide here is free, however, if you wish to donate, you can do so here: http://www.whatthetech.com/donate/

ASAP and UNITE member

________________________________________________


!


#3 appleoddity

appleoddity

    SuperMember

  • Tech Team
  • 3,071 posts
  • Interests:Eating, Movies, Family, Church, Music, Volleyball, Softball, Poker, Computers, Electronics, Reading.

Posted 13 June 2013 - 09:38 PM

Well, I can see you are using Java. I don't know Java. But, from researching the problem, the "throws exception" clause is used when declaring a function. Your code is clearly not declaring a function, it is calling a function and therefore "throws FileNotFoundException" is not valid in this context. The compiler expects an end of line after s=UsingFiles.setFileScanner("board1") thus the reason why it insists you put a semi-colon there and complains about anything extra like "throws FileNotFoundException." I derived that from my 5 minute crash course in Java - so I might be wrong.

The help you have been given is free. If you have been happy with our help please consider donating to support this forum.

If you would like to say thanks for the help I have given you please View My Profile and Leave a Comment.
Your encouragement is welcome.

Related Topics



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users