This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error with Url with java

 
david luis
Ranch Hand
Posts: 53
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Eclipse gives me these error with this code in java:

Error:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Unhandled exception type MalformedURLException

Could you help me please?

Many thanks and sorry for my english
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The definition of the URL class constructor says that it might throw a MalformedURLException. This is a checked exception, so your code needs to either catch or rethrow it. See the java exceptions tutorial for more details.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50251
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and welcome to the Ranch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic