• Post Reply Bookmark Topic Watch Topic
  • New Topic

URL connection questions... Urgent!!!!  RSS feed

 
christopson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question.
How can I get the URL if I read it directly from the keyboard?
Hello all,
For example I run the following program:
javac myurl.java http://www.mysite.com/index.html
Can I do something like this? Or I have to hard code the URL inside the class?
//////////////////////// myurl.java///////////////
public class myurl {
public static void main(String[] args) throws Exception {
URL aURL = new URL(args);
}
}
Could someone help me with this ?
 
Pradeepta Bhattacharya
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by christopson:
I have a question.
How can I get the URL if I read it directly from the keyboard?
Hello all,
For example I run the following program:
javac myurl.java http://www.mysite.com/index.html
Can I do something like this? Or I have to hard code the URL inside the class?
//////////////////////// myurl.java///////////////
public class myurl {
public static void main(String[] args) throws Exception {
URL aURL = new URL(args);
}
}
Could someone help me with this ?

i didn't get why javac urlname
 
christopson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeepta Bhattacharya:
i didn't get why javac urlname

Hi Pradeepta,
I got it.
Thanks,
Chris.
 
shailesh sonavadekar
Ranch Hand
Posts: 1874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
christopson , Welcome to javaranch.
PROPER NAMES ARE NOW REQUIRED
Please look carefully at official naming policy at javaranch & reregister yourself with proper first & last name. Please adhere to official naming policy & help maintain the decorum of the forum.
Waiting for your posts with proper first & last name. Once you have reregister , please let us know about that & then your previous account will be disabled.
Regards.

Your Friendly Bartender
Shailesh.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!