Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

throws Java.io.IOException

 
Harry Jones
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are these two statements the same, or is one better than the other?


Thanks.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15272
37
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are the same.

If you just use "IOException" instead of "java.io.IOException", you will have to put an import statement at the top of your source file:

import java.io.IOException;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic