title: How to cast a string to an URL in java?
body: <p>My java code is below.I wrote url=URL(s); but it is not true.I want to make a casting operation to convert a string that is taken from the user ,to an URL.How can I do this operation?Is there any method to do this?</p>
  
  <pre><code>    public static void main(String[] args) {
      System.out.println("Welcome to Download Manager");
      URL url;
      String s;
      Scanner scan= new Scanner(System.in);
      s=scan.nextLine();
      url=URL(s);
      Download download=new Download(url);
  }
  </code></pre>