This week's book giveaway is in the Agile forum.
We're giving away four copies of The Software Craftsman and have Sandro Mancuso on-line!
See this thread for details.
The moose likes Java in General and the fly likes need help regarding URL class ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "need help regarding URL class ?" Watch "need help regarding URL class ?" New topic

need help regarding URL class ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

i have some questions regarding URL class in ,
i have 2 q's
  • by using URL class we can download and upload data via http protocol just like what we do using ftp protocol ?
  • suppose i have a code where i m using URL class to connect to localhost through an http protocol so by default this code will conect to port 80 right ? ,
    but the big question is who will receive the data , if suppose i send some data like string ? i m asking this because using socket and server socket we know with whom we are connected or communicating and the server socket (server ) will receive our data and do some processing
    but who will receive the data in case of URL class ?

  • any explanation ?

    The Only way to learn is!
    Visit my blog
    William Brogden
    Author and all-around good cowpoke

    Joined: Mar 22, 2000
    Posts: 12912
    but who will receive the data in case of URL class ?

    If you create a URL that starts "http" the request will go to a HTTP server living at the specified host and listening at the default port (if you don't specify a port).

    If there is no HTTP server living at that location you will of course get an error.

    I agree. Here's the link:
    subject: need help regarding URL class ?